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

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