【发布时间】:2016-05-18 06:22:35
【问题描述】:
我现在正在编写一个应用程序,其中一部分会从 Windows 事件日志中抓取一些信息,它主要工作....
Dim strValue As String
Dim objLogs() As EventLog
Dim Logname As String = "Application"
Dim objEntry As EventLogEntry
Dim objLogEntry As EventLogEntry
Dim objLog As EventLog
objLogs = EventLog.GetEventLogs()
For Each objLog In objLogs
If objLog.LogDisplayName = Logname Then
For Each objLogEntry In objLog.Entries
WriteLine("EventID")
WriteLine("Machinename")
WriteLine("message")
Next
Exit For
End If
Next
这将愉快地写出 EventID、机器名称和事件消息。 details tab in event viewer
我不知道如何将事件查看器中的“详细信息”选项卡输出为字符串或类似内容。
MSDN 没有帮助,谁能指点我正确的方向?
提前致谢,
【问题讨论】: