版权声明:博主原创/资料整理,转载请注明出处!! https://blog.csdn.net/tiegenZ/article/details/80389624
将字符串写入txt文件
string hq="ashdahkd";
System.IO.File.WriteAllText(@"D:\log.txt", hq);
将数组写入txt文件
string[] lines = { "a", "b ", "c", "d" };
System.IO.File.WriteAllLines(@"D:\log1.txt", lines);