Operate File
1. 向文件中添加内容:
//create log file
if (System.IO.File.Exists("DeleteTempFilesLog.txt") == false)
{
System.IO.FileStream fs = new System.IO.FileStream("DeleteTempFilesLog.txt", System.IO.FileMode.Create);
fs.Close();
}
//add log
using (System.IO.StreamWriter sw = new System.IO.StreamWriter("DeleteTempFilesLog.txt", true))
{
sw.WriteLine(logInfo);
sw.WriteLine("-----------------------------------------------------");
}