事件查看器

来源:互联网 发布:left outer join数据库 编辑:程序博客网 时间:2024/05/01 07:48
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Diagnostics;namespace ConsoleApplication22{    class Program    {        static void Main(string[] args)        {           string sSource; //事件源            string sLog;    //事件日志(名),又称为日志名。一个日志名可以对应多个事件源。            string sEvent;  //消息            sSource = "litao application";            sLog = "李涛";            sEvent = "hello, word!";            if (!EventLog.SourceExists(sSource))                EventLog.CreateEventSource(sSource, sLog);            EventLog.WriteEntry(sSource, sEvent);            EventLog.WriteEntry(sSource, sEvent,            EventLogEntryType.Warning, 234);        }    }}


0 0