c#记录日志的方法
/// <summary>/// 生成日志/// </summary>/// <param name="text"></param>public static void WriteLog(string text){string logPath = System.AppDomain.CurrentDomain.BaseDirectory + "XiuJiaMontyly.log";using (StreamWriter sw = File.AppendText(logPath)){sw.WriteLine("消息:" + text);sw.WriteLine("時間:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));sw.WriteLine("**************************************************");sw.WriteLine();sw.Flush();sw.Close();sw.Dispose();}}
轉載于:https://www.cnblogs.com/yachao1120/p/9497937.html
總結
- 上一篇: [tyvj1935 Poetize3]导
- 下一篇: 牛客小白月赛6 H 挖沟