1.通过流的方式
 1         public void WriteLog(string log)
 2         {
 3             StreamWriter stream;
 4             string path = "D:/WriteLog/";
 5             if (!Directory.Exists(path))
 6             {
 7                 Directory.CreateDirectory(path);
 8             }
 9             stream = new StreamWriter(path + "AddVideo.txt", true, Encoding.UTF8);
10             stream.WriteLine(DateTime.Now.ToString() + ":" + log);
11             stream.Flush();
12             stream.Close();
13         }
View Code

相关文章:

  • 2022-02-04
  • 2021-07-17
  • 2022-12-23
  • 2022-01-20
  • 2021-12-24
  • 2021-12-27
  • 2022-01-01
  • 2021-10-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2021-06-15
相关资源
相似解决方案