コード例 #1
0
ファイル: LogService.cs プロジェクト: 842549829/Notify
 /// <summary>
 /// The log.
 /// </summary>
 /// <param name="content">
 /// The content.
 /// </param>
 /// <param name="path">
 /// The path.
 /// </param>
 /// <returns>
 /// The 
 /// </returns>
 internal static bool Log(string content, string path)
 {
     lock (obj)
     {
         try
         {
             TextWriter textWriter = new TextWriter(path);
             return
                 textWriter.WriteLog(
                     DateTime.Now.ToString("日志时间:yyyy-MM-dd HH:mm:ss") + Environment.NewLine + content
                     + Environment.NewLine);
         }
         catch (System.Exception)
         {
             return false;
         }
     }
 }