• Categories

  • Pages

  • Tags

  • Archives

  • Meta

  • c# Event ID?

    Posted by admin on December 8th, 2009 and filed under event id | 1 Comment »

    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

    One Response

    1. crescent_fresh_sock Says:

      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 :

    Leave a Comment

    Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.