Пример #1
0
        public void Log(string message, LogLevel logLevel)
        {
            string text = $"{DateTime.Now} [{logLevel.ToString().ToUpper()}]: {message}" + Environment.NewLine;

            File.AppendAllText(path, text);
        }
Пример #2
0
 public void Dispose()
 {
     File.AppendAllText(outputFilePath, "endcode");
 }
Пример #3
0
 /// <summary>
 /// 向文本文件的尾部追加内容
 /// </summary>
 /// <param name="filePath">文件的绝对路径</param>
 /// <param name="content">写入的内容</param>
 public static void AppendText(string filePath, string content)
 {
     File.AppendAllText(filePath, content);
 }
Пример #4
0
 public void WriteLine(string message)
 {
     message = $"{message}\r\n";
     File.AppendAllText(outputFilePath, message);
 }