c#如何在新行中添加文本

如题所述

string path= System.Windows.Forms.Application.StartupPath + "\\ErrorLog\\"+fileName +".txt"; //打开这个文件
if (!File.Exists(path))
{
FileInfo myfile = new FileInfo(path);
FileStream fs = myfile.Create();
fs.Close();
}
StreamWriter sw = File.AppendText(path);
sw.WriteLine("啊实打实的");//追加这一行
sw.Flush();
sw.Close();
温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-05-10
在一个txt文本文件中加入?
相似回答