1.14.3. fejezet, SystemLog

            System.Diagnostics.EventLog appLog =
            new System.Diagnostics.EventLog();
            appLog.Source = "SwitchHost";
            try
            {
                appLog.WriteEntry("Program ready.");
 
                Console.WriteLine("ready.");
                Console.ReadKey();
            }
            catch (System.UnauthorizedAccessException ex)
            {
                appLog.WriteEntry("SwitchHost error:" + ex.Message);
                Console.WriteLine(ex.Message);
            }
            catch (FileNotFoundException ex)
            {
                appLog.WriteEntry("Config file not found");
                Console.WriteLine(ex.Message);
                Console.ReadKey();
            }
            appLog.Close();