【发布时间】:2018-04-16 08:23:53
【问题描述】:
我正在尝试使用 System.Diagnostics 中的 EventLog 类读取存储的 .evtx。 但它不起作用。
难道不能用 EventLog 类读取存储的 evtx 文件吗?或者问题出在哪里?
下面是我的代码
string source = @"S:\test.evtx";
EventLog eventLog = new EventLog();
eventLog.Source = source;
foreach (EventLogEntry log in eventLog.Entries)
{
Console.WriteLine("{0}\n", log.Message);
}
【问题讨论】:
标签: c# windows event-log eventlog-source