是否有人在不使用JNI的情况下如何读取Windows EventLog的任何指针?或者,如果您必须使用JNI,是否有任何好的开放源代码库?

最佳答案

JNA 3.2.8同时具有所有事件记录功能的实现和Java迭代器。阅读this

EventLogIterator iter = new EventLogIterator("Application");
while(iter.hasNext()) {
    EventLogRecord record = iter.next();
    System.out.println(record.getRecordId()
            + ": Event ID: " + record.getEventId()
            + ", Event Type: " + record.getType()
            + ", Event Source: " + record.getSource());
}

10-07 22:21
查看更多