Ken H.
asked on
Parse .evt files with vb.net
I'm looking for code that will parse .evt log files in vb.net. I have found examples in C# but not vb.
The .evt files are not the local system files. They are part of a data collection performed from remote hosts so i'm looking for code where I can specify a filepath to the .evt files.
Code that outputs to a gridview would be nice. I'm sure this has been done time and time again by different people so I'd rather not "recreate the wheel" and just use what's out there.
The .evt files are not the local system files. They are part of a data collection performed from remote hosts so i'm looking for code where I can specify a filepath to the .evt files.
Code that outputs to a gridview would be nice. I'm sure this has been done time and time again by different people so I'd rather not "recreate the wheel" and just use what's out there.
ASKER
The code for that parser is in c#. I know nothing about C and my project is in VB so i'm hoping someone can help me with a vb implementation.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Ok the only thing I'm having trouble with now is how can i code this to pull an event log from a string path?
That expects "Application" "System" etc. Putting a string value to a .evt file throws an exception.
Dim objEventLog As EventLog = New EventLog(strLogName)
That expects "Application" "System" etc. Putting a string value to a .evt file throws an exception.
ASKER
I'm accepting this as the solution because I was not aware of these. I'm sure this will come in useful at some point.
The route I am taking with this issue is to convert the .evt files into .csv using the microsoft logparser tool. Then from the CSV file I will bring the data into my application.
The route I am taking with this issue is to convert the .evt files into .csv using the microsoft logparser tool. Then from the CSV file I will bring the data into my application.
ASKER
Breakpoint shows "Network path not found" ... so i must be doing something wrong but based on the MS EventLogEntry class my code should be correct to pull the log "EventLog(String, String, String)". Not sure about my dropping it to a multiline text box but I've gotta get the data in before I worry about that.
Open in new window