Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,everyone!
I am wondering how to get the full 'windows log'(not only the ones shown with the eventviewer but also all the eventlogs since the system was setted)?
Need your help!
Wishing for your reply!
Posted

1 solution

Take a look at EventLog.GetEventLogs Method[^]:

Quote:
The array of EventLog objects is a snapshot of all event logs on the computer specified by the machineName parameter when the call to GetEventLogs is made. This is not a dynamic collection, so it does not reflect the deletion or creation of logs in real time. You should verify that a log in the array exists before you read or write to it. The array usually includes at least three logs: Application, System, and Security. If you created custom logs on the specified computer, they will appear in the array as well.

GetEventLogs is a static method, so it can be called on the EventLog class itself. It is not necessary to create an instance of an EventLog object to make a call to the method.

To retrieve the list of event logs, you must have the appropriate registry permissions. These permissions are identical to those required to call Exists and SourceExists.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900