예제 #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
파일: DirFile.cs 프로젝트: wangxiaoyi12/Web
 /// <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);
 }