Log into event viewer using c#
This code will write directly to the event log Application:
//Reference
using System.Diagnostics;
//Program
//Reference
using System.Diagnostics;
//Program
using (EventLog eventLog = new EventLog("Application"))
{
eventLog.Source = "Application";
eventLog.WriteEntry("Your Message", EventLogEntryType.Information, 101, 1);
}
{
eventLog.Source = "Application";
eventLog.WriteEntry("Your Message", EventLogEntryType.Information, 101, 1);
}
Figure below depicts the event viewer log:
Comments
Post a Comment