日期:2014-05-18 浏览次数:21054 次
string[] arr1 = File.ReadAllLines(@"C:\1.txt", Encoding.GetEncoding("GB2312")); string[] arr2 = File.ReadAllLines(@"C:\3.txt", Encoding.GetEncoding("GB2312")); string[] arr0 = (from str1 in arr1 select str1).Intersect(from str2 in arr2 select str2).ToArray(); File.WriteAllLines(@"C:\2.txt",arr0);