首页 > 解决方案 > 如何使用 C++ 读取特定的事件日志条目?

问题描述

如何使用事件 ID 从事件日志中获取特定的事件日志条目

      I have tried ReadEventlog samples but it gets all the event i need to run a while loop to filter.

相反,请让我知道我们如何使用任何直接方法或使用 C++ 的查询来实现它。

     its like Example if we have 3000 events out of that 1000 event has Event id:150 .

我们如何查询它。

我试过的代码:

        while (ERROR_SUCCESS == status)
{
    if (!ReadEventLog(hEventLog, 
        EVENTLOG_SEQUENTIAL_READ | EVENTLOG_BACKWARDS_READ,
        0, 
        pBuffer,
        dwBytesToRead,
        &dwBytesRead,
        &dwMinimumBytesToRead))
    {
          ....
    }
 }

标签: c++visual-studioc++11event-viewer

解决方案


推荐阅读