using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.IO; namespace XSKZQ.Log { public class XKLog { //private static string FileDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\log\\"; private static string FileDir = System.IO.Path.GetDirectoryName(@"/SDMemory/") + "\\log\\"; private static readonly object log_Lock = new object(); /// <summary> /// 显控日志写入 /// </summary> /// <param name="log"></param> public void WriteLog(string log) { if (!Directory.Exists(FileDir)) Directory.CreateDirectory(FileDir); string FileName = FileDir + DateTime.Now.ToString("yyyy-MM-dd") + ".txt
C#日志方法
最新推荐文章于 2024-06-14 21:38:24 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)