我的要求是从事件日志中读取事件条目并将其存储在数据库中.读取单个条目并存储到数据库后,我需要将其从事件日志中删除.
My requirement is to read event entries from event log and store them in database. After reading single entry and storing into database, I need to remove this from event log.
我正在使用 EventLog 类读取同一台计算机上的事件条目.此类支持循环读取条目,但不允许一个接一个地删除条目.
I am using EventLog class to read event entries on same computer. This class is supporting to read entries one by one in loop but it's not allowing to delete entries one by one.
EventLog 类仅支持一次清除所有条目.我无法清除完整的事件日志,因为在进行读取操作时会添加新事件.
EventLog class supports to clear all entries in one shot only. I can't clear the full event log because new events are being added while read operation is going on.
请让我知道是否可以使用其他.Net类来实现这一目标.
Please let me know if I can use a different .Net class to achieve this.
推荐答案这是不可能的.全部或全部.看到这个问题:
It's not possible.. It's all or nothing. See this question:
C#管理Windows事件
更多推荐
如何从事件日志中删除特定的事件条目?
发布评论