如何从事件日志中删除特定的事件条目?

编程入门 行业动态 更新时间:2024-10-28 06:34:08
本文介绍了如何从事件日志中删除特定的事件条目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的要求是从事件日志中读取事件条目并将其存储在数据库中.读取单个条目并存储到数据库后,我需要将其从事件日志中删除.

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事件

更多推荐

如何从事件日志中删除特定的事件条目?

本文发布于:2023-11-11 13:39:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578597.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:事件   条目   日志

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!