用流的方式写入记事本

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         }

 

posted @ 2015-02-26 10:15  曹杰博  阅读(186)  评论(0编辑  收藏  举报