【发布时间】:2011-07-12 18:58:06
【问题描述】:
以下代码 sn-p 在记录事件时触发事件。示例代码运行良好,但我要监控的日志实际上是“应用程序和服务日志 > Microsoft > Windows > 任务计划程序 > 操作”。
我应该在代码示例中插入什么来代替“应用程序”?
...
EventLog myNewLog = new EventLog("Application", ".", "testEventLogEvent");
myNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten);
myNewLog.EnableRaisingEvents = true;
...
【问题讨论】: