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"); }
/// <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); }