Here's what MSDN says about EventLogEntry.CategoryNumber
The Event Viewer can display the category as a numeric value, or it can use the category as a resource identifier to display a localized category string.
I checked the code in Vista. For some reason Security event categories were all dumped as CategoryNumber. I checked Application event categories and I got category numbers but also textual category names when one existed.
So, if you want to get names for the categories, instead of the category numbers, you'll have to find which is the resource file and use category number to get textual name directly from the resource file.
I'm just guessing how this should be done. There may be a much better way to do it, I just didn't figure it out.
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Offline 1,024 posts
since Aug 2008