Search code examples
c#windows-server-2003event-log

Read Event Log on Windows Server 2003


I wrote a program to read the event log, and it works great on Windows server 2008, however when I run it on Windows Server 2003 it throws an exception "Operation is not supported on this platform". I know it's caused by the EventLogReader class. So my question is, how can my program read the event log on a Windows Server 2003?


Solution

  • You'll need to create an instance of the EventLog Class and then iterate through the collection in the EventLog.Entries Property.