Write to the Event Log In VB.NET

Category:
C#, VB.NET, ASP.NET
Type:
Snippets
Difficulty:
Beginning
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic.NET

More information:
This function uses Event Log objects from the System.Diagnostics Namespace to write to the event log in Visual Basic.NET. Refer to the comments for more information.

Originally developed for .NET Beta versions; verified to work in VB.NET 1.0 03/25/02.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: