The Following sample code helps to Read Data from Event Log. This is a sample windows application written by using C#.
In the following sample code, I used 2 controls, Listbox and EventLog Controls.
Set the Log Property of Eventlog control to name of the log to read or write. I selected System Log to test this code
In the Form Load Event, I written the following code,
foreach (System.Diagnostics.EventLogEntry entry in eventLog1.Entries)
{
listBox1.Items.Add(entry.EntryType.ToString() + " - " + entry.TimeWritten + " - " + entry.Source + " - " + entry.UserName);
}
This code, read the Data from Log file and written display in to listbox control.Now if run the code, it will display as shown in screen shot
Windows Event Helper C# "Integration with EventLog"::
ReplyDeletehttp://ledomoon.blogspot.com/2008/08/windows-event-helper-c-with-eventlog.html
thanks 4 this tutorial this tutorial help to view event log entries
ReplyDeleteBest Regards from MANAS
there are some other ways of how can recover an Excel sheet
ReplyDelete