日期:2014-05-17 浏览次数:20932 次
string[] lines = File.ReadAllLines(@"C:\Documents and Settings\Administrator\桌面\Test.txt", Encoding.GetEncoding("GB2312")); lines = lines.Where((a, i) => ++i!=2).ToArray();//删除第二行 File.WriteAllLines(@"C:\Documents and Settings\Administrator\桌面\Test.txt",lines);//写回去