C#追加内容到文本文件中
using SYSTEM.IO;
//C#追加文件
StreamWriter sw=File.AppendText(Server.MapPath(".")+"\\myText.txt");
sw.WriteLine("追逐理想");
sw.WriteLine("kzlll");
sw.WriteLine(".NET笔记");
sw.Flush();
sw.Close();
StreamWriter sw=File.AppendText(System.Windows.Forms.Application.StartupPath+"\\lgcx.log");
sw.WriteLine(SysLog.FProgramName+SysLog.FCreateName+SysLog.FTime+SysLog.FId+SysLog.FPath+SysLog.FDesc);
//sw.WriteLine("kzlll1");
//sw.WriteLine(".NET笔记1");
sw.Flush();
sw.Close();
//C#追加文件
StreamWriter sw=File.AppendText(Server.MapPath(".")+"\\myText.txt");
sw.WriteLine("追逐理想");
sw.WriteLine("kzlll");
sw.WriteLine(".NET笔记");
sw.Flush();
sw.Close();
StreamWriter sw=File.AppendText(System.Windows.Forms.Application.StartupPath+"\\lgcx.log");
sw.WriteLine(SysLog.FProgramName+SysLog.FCreateName+SysLog.FTime+SysLog.FId+SysLog.FPath+SysLog.FDesc);
//sw.WriteLine("kzlll1");
//sw.WriteLine(".NET笔记1");
sw.Flush();
sw.Close();