EventLog的几种参数写法
using System.Diagnostics;
if (!EventLog.SourceExists("EventLogDemoApp"))
{
EventSourceCreationData eventSourceData =
new EventSourceCreationData("EventlogDemoApp", "ProCSharpLog");
EventLog.CreateEventSource(eventSourceData);
}
EventLog log = new EventLog("ProCSharpLog", ".", "EventLogDemoApp");
log.WriteEntry("Message 1");
log.WriteEntry("Message 2", EventLogEntryType.Warning);
log.WriteEntry("Message 3", EventLogEntryType.Information, 33);
log.Dispose();
关于作者:
王昕(QQ:475660)
在广州工作生活30余年。十多年开发经验,在Java、即时通讯、NoSQL、BPM、大数据等领域较有经验。
目前维护的开源产品:https://gitee.com/475660
目前维护的开源产品:https://gitee.com/475660