C# txt文件操作
阿新 • • 發佈:2018-11-24
string path = AppDomain.CurrentDomain.BaseDirectory + "operalog.txt";
if (!System.IO.File.Exists(path))
{
FileStream stream = System.IO.File.Create(path);
stream.Close();
stream.Dispose();
}
using (StreamWriter writer = new StreamWriter(path, true))
{
writer.WriteLine(CCNO);
writer.WriteLine(CCtype);
writer.WriteLine(Status);
writer.WriteLine(clsPageCond.limit);
writer.WriteLine(clsPageCond.Page);
}
if (!System.IO.File.Exists(path))
{
FileStream stream = System.IO.File.Create(path);
stream.Close();
stream.Dispose();
}
using (StreamWriter writer = new StreamWriter(path, true))
{
writer.WriteLine(CCNO);
writer.WriteLine(CCtype);
writer.WriteLine(Status);
writer.WriteLine(clsPageCond.limit);
writer.WriteLine(clsPageCond.Page);
}