最简单的日志

最简单的日志:

public class Logger
{
    public static void Trace(string title,string message)
    {
        string path = System.Windows.Forms.Application.StartupPath + "\\Log.txt";
 
        StreamWriter sw = new StreamWriter(path,true);
        sw.Write("{0}:{1}", title, message);
        sw.Flush();
        sw.Close();
    }
}
原文地址:https://www.cnblogs.com/hongjiumu/p/3003145.html