C#创建日志方法

1.通过流的方式
C#创建日志方法
 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

C#创建日志方法

上一篇:C# yield return 用法与解析


下一篇:下列软件包有未满足的依赖关系: gsettings-desktop-schemas : 破坏: mutter (< 3.