private void button1_Click(object sender, EventArgs e)
{
string[] array1 = { "C:/folder/a.txt", "C:/folder/b.txt", "C:/folder/c.txt", "C:/folder/d.txt" };
string[] array2 = { "D:/a.txt", "D:/b.txt", "D:/c.txt", "D:/d.txt" };
var hash1 = new HashSet<string>(array1);
var hash2 = new HashSet<string>(array2);
}
我想比较hash1
和hash2
。如果a.txt
文件存在,hash2
则从. 我们可以在没有迭代值的情况下做到这一点吗? C:/folder/a.txt
hash1