use*_*394 6 c# windows event-log windows-vista
有没有办法在生成(C#)时观察"应用程序和服务"的事件?我发现我不能使用WMI.
还有其他想法吗?
将条目写入本地计算机上的事件日志时发生.
来自MSDN:
....
EventLog myNewLog = new EventLog();
myNewLog.Log = "MyCustomLog";
myNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten);
myNewLog.EnableRaisingEvents = true;
}
public static void MyOnEntryWritten(object source, EntryWrittenEventArgs e){
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4625 次 |
| 最近记录: |