/// /// 输出指定信息到文本文件
/// ///文本文件路径 ///输出信息 public void WriteMessage(string path,string msg) { using (FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write)) { using (StreamWriter sw = new StreamWriter(fs)) { sw.BaseStream.Seek(0, SeekOrigin.End); sw.WriteLine("{0}\n", msg, DateTime.Now); sw.Flush(); } } }