I can’t fill the Event ID area in the event viewer log file. I couldn’t find the Event ID field. Please help me.
My c# code is as fallowing:
private static void writelog(string name)
{
EventLog elog = new EventLog();
elog.Log="Application";
elog.source=name;
elog.WriteEntry(name+ " created today!");
elog.close();
}
Try this:
EventLog elog = new EventLog();
elog.Source = name;
el.WriteEvent(new EventInstance({event_id}, {category}), {params});
where {event_id} is the field you are looking for
December 9th, 2009 at 12:10 am
Try this:
EventLog elog = new EventLog();
elog.Source = name;
el.WriteEvent(new EventInstance({event_id}, {category}), {params});
where {event_id} is the field you are looking for
References :