用流的方式写入记事本

1  private void LogWrite(string text)
2         {
3             FileStream fs = new FileStream(this.Server.MapPath("/log.txt"), FileMode.Append);
4             StreamWriter sw = new StreamWriter(fs);
5             sw.WriteLine(text);
6             sw.Close();
7             fs.Close();
8         }

 

你可能感兴趣的:(记事本)