如何将日志写入Windows日志文件? (Windows XP)
如何查找我的Web服务的虚拟目录(来自Web服务)?
提前谢谢
答案 0 :(得分:1)
写入事件日志:
System.Diagnostics.EventLog.CreateEventSource(strMyApp, "Application");
EventLog MyEventLog = new EventLog();
MyEventLog.Source = strMyApp;
MyEventLog.WriteEntry(strEvent, EventLogEntryType.Warning);
查找虚拟目录:
http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx