我有一小段代码可以从 eventvwr 读取“系统”事件
EventLog eventLog = new EventLog("System");
foreach (EventLogEntry log in eventLog.Entries)
{
Console.WriteLine("{0}\n", log.Message);
}
这很好用,但对于少数事件日志,我会收到类似的消息
"The description for Event ID '109' in Source 'Microsoft-Windows-Kernel-Power' cannot be found. The local computer may not have the necessary registry information or message DLL files to display the message, or you may not have permission to access them. The following information is part of the event:'6', '0', '5'"
当我打开 eventvwr 时,我可以看到那里的描述。
The kernel power manager has initiated a shutdown transition.
Shutdown Reason: Kernel API
我以管理员身份运行此代码。
谁能帮我弄清楚为什么我会收到这样的消息进行描述。提前致谢
有类似的帖子,但没有人提出这个问题。例如这个