栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

读取特定的Windows事件日志事件

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

读取特定的Windows事件日志事件

没有!没有可用的功能,该功能使您可以基于事件ID获取事件。

参考:事件记录功能

GetNumberOfEventLogRecords  Retrieves the number of records in the specified event log.GetOldestEventLogRecord     Retrieves the absolute record number of the oldest record       in the specified event log.NotifyChangeEventLog        Enables an application to receive notification when an event      is written to the specified event log.ReadEventLog     Reads a whole number of entries from the specified event log.RegisterEventSource         Retrieves a registered handle to the specified event log.

唯一感兴趣的其他方法是读取最早的事件。

您将必须以任何方式遍历结果,并且您的方法正确:)

您只能像下面那样更改方法的形式,但这是不必要的。

events = win32evtlog.ReadEventLog(hand, flags,0)events_list = [event for event in events if event.EventID == "27035"]if event_list:    print 'Event Category:', events_list[0].EventCategory

这和您做的一样,但更简洁



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/626318.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号