我需要Audit Failure在记录时立即访问Window log->Security 事件,有什么方法可以在记录时立即捕获它。我需要访问实时尝试。
目前我正在从EventLogEntryc# 中的类中阅读此内容,但我需要一个我的应用程序在Audit Failure发生时运行。
foreach (EventLogEntry entry in log.Entries)
{
if (entry.EntryType==EventLogEntryType.FailureAudit)
{
///
}
}
一些类似于:
EventLog myNewLog = new EventLog();
myNewLog.Log = "MyCustomLog";
myNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten);
myNewLog.EnableRaisingEvents = true;
事件日志事件,有些像这样我也想触发 windows 日志