我想写从C#一个txt文件,如下所示:AppendAllLines替代解决方案
File.WriteAllText("important.txt", Convert.ToString(c));
File.AppendAllLines("important.txt", (from r in rec
select r.name + " " + r.num1 + " " + r.num2 + " " + r.mult + " " + r.rel).ToArray());
我收到错误AppendAllLInes
没有发现有System.IO.File任何替代方法或我怎么能包括AppendAllLInes
是否使用的是.NET的版本? AppendAllLines是在4.0或Visual Studio 2010中添加的。如果您使用的是以前的版本,则需要使用不同的解决方案。 – 2012-03-31 23:55:42
我正在使用visual studio 2008 ...你能给我建议任何替代解决方案吗? – 2012-03-31 23:57:50