EventLog eventLog1 =new EventLog("System");
//eventLog1.SynchronizingObject = this;
//this.eventLog1.Log = "System";
//this.eventLog1.Log = "Security";
//this.eventLog1.Log = "Application";
EventLogEntryCollection collection = eventLog1.Entries;
int Count = collection.Count;
string info = "显示系统日志" + Count.ToString() + "个事件。";
foreach (EventLogEntry entry in collection)
{
info += "/n/n类型:" + entry.EntryType.ToString();
info += "/n/n日期:" + entry.TimeGenerated.ToLongDateString();
info += "/n/n时间:" + entry.TimeGenerated.ToLongTimeString();
info += "/n/n来源:" + entry.Source;
info += "/n/n事件:" + entry.EventID.ToString();
info += "/n/n用户:" + entry.UserName;
info += "/n/n计算机:" + entry.MachineName;
}
获取计算机日志信息
最新推荐文章于 2022-03-09 11:40:32 发布