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
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/47489.html
標籤:其他
上一篇:hbase存盤設計問題
下一篇:值型別與參考型別的區別
