标签:help style dir try ade nal current ignore exit
public class LogHelper { private static readonly ReaderWriterLockSlim LogWriteLock = new ReaderWriterLockSlim(); private static readonly string LogFilePath = Environment.CurrentDirectory + "\\log.txt"; public static void Log(string content) { try { LogWriteLock.EnterWriteLock(); string data = DateTime.Now + ":" + content+Environment.NewLine; File.AppendAllText(LogFilePath, data); } catch (Exception) { // ignored } finally { LogWriteLock.ExitWriteLock(); } } }
标签:help style dir try ade nal current ignore exit
原文地址:https://www.cnblogs.com/chlm/p/12720069.html