标签:
一、直接写入文件
/// <summary> /// 将message的内容写入日志文件 /// </summary> /// <param name="msg"></param> public static void LogToFile(string msg) { string path = Application.StartupPath + "\\logFile"; File.AppendAllText(path, string.Format("[{0}] : {1}{2}", DateTime.Now, msg, Environment.NewLine)); }
二、通过插件
标签:
原文地址:http://www.cnblogs.com/shenchao/p/4761377.html