Is there a way to watch events of "applications and services" when they are generated (in C#)? I've figured out that I can not use WMI for it.
Any other ideas?
You can subscribe to EventLog.EntryWritten Event
Occurs when an entry is written to an event log on the local computer.
From MSDN:
....
EventLog myNewLog = new EventLog();
myNewLog.Log = "MyCustomLog";
myNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten);
myNewLog.EnableRaisingEvents = true;
}
public static void MyOnEntryWritten(object source, EntryWrittenEventArgs e){
}
Did your try it wit the EventLog.EntryWritten Event?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With