How can I read the property's "Description" of a security Log's en

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using vs2005, .net 2.0 on Windows 2000 server.
When I double click on an entry of the "Security" log in the system's "Event
Viewer", a Property window pops up. In this window, there is a "Description"
section that lists many different information like "User Name:, "Domain",
"Login ID"......
How can I obtain each of this inforation in my program? Thank you.
 
Pucca said:
I'm using vs2005, .net 2.0 on Windows 2000 server.
When I double click on an entry of the "Security" log in the system's "Event
Viewer", a Property window pops up. In this window, there is a "Description"
section that lists many different information like "User Name:, "Domain",
"Login ID"......
How can I obtain each of this inforation in my program? Thank you.

Try using the EventLog and EventLogEntry classes in System.Diagnostics:

EventLog eventLog = new EventLog("Security");
foreach (EventLogEntry entry in eventLog.Entries)
{
Console.Out.WriteLine(entry.Message);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top