自定义事件日志查询

时间:2014-08-23 22:31:32

标签: c# event-log

我已经创建了这个自定义视图事件日志调用" Logs" ,并尝试从C sharp访问它,但是在所有可能的方式我都无法获取数据从中。自定义过滤以显示仅显示某些事件并仅获取此事件。

如何从自定义事件日志帮助查询数据

String log = "Logs";
                    EventLog aLog = new EventLog(log, machine);
                    EventLogEntry entry;
                    EventLogEntryCollection entries = aLog.Entries;
                    Stack<EventLogEntry> stack = new Stack<EventLogEntry>();
                    for (int i=index; i < entries.Count;i++)
                    {
                        entry = entries[i];
                        stack.Push(entry);
                        entry = stack.Pop();
                        index = i;
                        long eventid=entry.InstanceId;
                        if (eventid != 4634 && eventid != 4624)
                        {
                            userAccountManager(entry, stack, eventid);

                            ///
                        }
                    }

这里是日志的位置:

enter image description here

0 个答案:

没有答案
相关问题