Specify EventLogEntryType : Event Log : Windows C# Source Code


Custom Search

C# Source Code » Windows » Event Log »

 

Specify EventLogEntryType








    




using System;
using System.Diagnostics;

class MainClass {
    public static void Main() {
        if (!EventLog.SourceExists("C#")) {
            EventLog.CreateEventSource("C#", "Application");
        }

        EventLog.WriteEntry(
            "C#",                          // Registered event source
            "A simple test event.",        // Event entry message
            EventLogEntryType.Information, // Event type
            1,                             // Application-specific ID
            0,                             // Application-specific category
            new byte[] { 10, 55, 200 }       // Event data
        );
    }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Windows
» Event Log