Cacheing remote event log
From: Rob Oldfield (blah_at_blah.com)
Date: 03/03/05
- Next message: Morten Wennevik: "Re: Combobox Highlighting Issues"
- Previous message: Matt Garven: "RE: Modal Dialog Box By Reflection?"
- Next in thread: Rob Oldfield: "Re: Cacheing remote event log"
- Reply: Rob Oldfield: "Re: Cacheing remote event log"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 3 Mar 2005 09:11:04 -0000
I have some code that loops through the entires in an event log which works
fine... but very, very slowly. I've found something on the web that claims
that using the copyto method of the entrycollection class to cache the
entries locally will speed things up... but I can't figure out how to get it
to work.
My code currently looks like this...
EventLog1.MachineName = Me.Machine.Text
EventLog1.Log = Me.LogName.Text
For Each ent In EventLog1.Entries
'work on entry
Next
...and I've found this in the help files...
Dim myEventLogEntryArray(myEventLogEntryCollection.Count - 1) As
EventLogEntry
myEventLogEntryCollection.CopyTo(myEventLogEntryArray, 0)
Dim myEnumerator As IEnumerator = myEventLogEntryArray.GetEnumerator()
While myEnumerator.MoveNext()
Dim myEventLogEntry As EventLogEntry = CType(myEnumerator.Current,
EventLogEntry)
Console.WriteLine("The LocalTime the Event is generated is " + _
myEventLogEntry.TimeGenerated)
End While
.... but I can't figure out how to fit them together. Can anyone point me
in the right direction? Thanks.
- Next message: Morten Wennevik: "Re: Combobox Highlighting Issues"
- Previous message: Matt Garven: "RE: Modal Dialog Box By Reflection?"
- Next in thread: Rob Oldfield: "Re: Cacheing remote event log"
- Reply: Rob Oldfield: "Re: Cacheing remote event log"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|