我尝试将新日志写入MyLog,但它总是写入应用程序日志(Windows Log)
string sSource;
string sLog;
sSource = "MySource";
sLog = "MyLog";
if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource, sLog);
using (EventLog eventLog = new EventLog(sLog))
{
eventLog.Source = sSource;
eventLog.WriteEntry("Log message example", EventLogEntryType.Information, 101, 1);
}我尝试删除注册表上的日志条目以重新创建日志,但问题仍然存在。
帮个忙吧。
https://stackoverflow.com/questions/44536635
复制相似问题