CSharp examples for System:Windows
Write an Event to the Windows Event Log
using System;/* ww w . j a v a2 s. c o m*/ using System.Diagnostics; class MainClass { public static void Main () { if (!EventLog.SourceExists("from book2s.com")) { EventLog.CreateEventSource("from book2s.com", "Application"); } EventLog.WriteEntry( "from book2s.com", // 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 ); } }