最简单的日志:
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/archive/2013/04/06/3003145.html