有没有办法在生成“应用程序和服务”事件时监视它们(在 C# 中)?
我发现我不能使用 WMI。
还有其他想法吗?
您可以订阅EventLog.EntryWritten 事件
当条目写入本地计算机上的事件日志时发生。
来自 MSDN:
....
EventLog myNewLog = new EventLog();
myNewLog.Log = "MyCustomLog";
myNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten);
myNewLog.EnableRaisingEvents = true;
}
public static void MyOnEntryWritten(object source, EntryWrittenEventArgs e){
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)