EventLog

 //HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application

            string source = "WCF Event Log";
            if (!EventLog.SourceExists(source))
            {
                EventLog.CreateEventSource(source, "Application");
            }

            EventLog myLog = new EventLog();
            myLog.Source = source;
            myLog.WriteEntry("1111", EventLogEntryType.Error);

posted @ 2010-12-22 16:28  RobotTech  阅读(311)  评论(0编辑  收藏  举报