using System; using System.Resources; using System.Drawing; using System.Collections; using System.Windows.Forms; using System.Diagnostics; using Microsoft.Win32; using System.Resources;
class MyEventLogClass { static void Main(string[] args) { EventLog MyEventLog = new EventLog(); MyEventLog.Log = "Application"; MyEventLog.Source = "www.Dotnetspider.com"; MyEventLog.WriteEntry("Testing message"); for(int count = 0; count < 10; count++) { Console.WriteLine("Message: " + MyEventLog.Entries[count].Message ); Console.WriteLine("Machine: " + MyEventLog.Entries[count].MachineName ); Console.WriteLine("Sounce : " + MyEventLog.Entries[count].Source ); Console.WriteLine("Time : " + MyEventLog.Entries[count].TimeWritten); } MyEventLog.Close(); } }