【发布时间】:2013-01-02 18:59:53
【问题描述】:
使用命名空间System.Diagnostics.Eventing.Reader 中的新EventLogReader 与以通常方式创建和EventLog 并读取条目的传统方法相比有什么好处?
【问题讨论】:
标签: c# .net event-log event-viewer
使用命名空间System.Diagnostics.Eventing.Reader 中的新EventLogReader 与以通常方式创建和EventLog 并读取条目的传统方法相比有什么好处?
【问题讨论】:
标签: c# .net event-log event-viewer
传统方法的问题是您必须将所有条目加载到内存中,然后在客户端上过滤它们 - EventLog.Entries 集合将所有内容加载到内存中。
使用新方法,事件将不会加载到客户端。您可以write queries 仅检索客户端上您感兴趣的事件。
因此,如果您使用新类,您将消耗更少的内存,并且您的代码可能会运行得更快。
【讨论】:
Is the only benefit efficiency and performance. - 如果这还不够 :-) Is there additional information recoding and retrieved? - 不。