1 StreamWriter sw = new StreamWriter(@"d:\log.txt",true); 2 sw.WriteLine(System.DateTime.Now.ToString() + " " + "This is a test message!"); 3 sw.Flush();
Tips: 1.True是为了将数据追加到最后.
1 StreamWriter sw = new StreamWriter(@"d:\log.txt",true); 2 sw.WriteLine(System.DateTime.Now.ToString() + " " + "This is a test message!"); 3 sw.Flush();
Tips: 1.True是为了将数据追加到最后.