using System; using System.Configuration; using System.IO; namespace ToIO { class Program { static void Main(string[] args) { for (int i = 0; i < 10; i++) { WriteLog("Index=" + i); } } public static void WriteLog(string logMessage) { using (StreamWriter w = File.AppendText(@"E:/log.txt")) { w.WriteLine("'{0}',", logMessage); w.Flush(); } } } }
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/278903.html