写window应用程序日志System.Diagnostics.EventLog.WriteEntry
System.Diagnostics.EventLog.WriteEntry( MySource , Writing to event log. ); 可以写window应用程序日志
查看的地方:右击我的电脑-->管理
查看代码运行时间的时候可以使用,
方法时间统计
DateTime dtBegin = DateTime.Now;
wodefangfayi(“asdfasdf”);
System.Diagnostics.EventLog.WriteEntry("wodefangfayi总共耗时间" + (DateTime.Now - dtBegin).TotalMilliseconds.ToString(), (DateTime.Now - dtBegin).TotalMilliseconds.ToString());
dtBegin = DateTime.Now;
wodefangfaer(“asdfasdf”);
System.Diagnostics.EventLog.WriteEntry("wodefangfaer总共耗时间" + (DateTime.Now - dtBegin).TotalMilliseconds.ToString(), (DateTime.Now - dtBegin).TotalMilliseconds.ToString());
dtBegin = DateTime.Now;