It is as simple as this to write to the Windows Event Log in .NET
Public Function WriteToEventLog(ByVal Entry As String, _ Optional ByVal AppName As String = "APlusFeeCalc", _ Optional ByVal EventType As EventLogEntryType = EventLogEntryType.Information, _ Optional ByVal LogName As String = "Application") As Boolean Dim objEventLog As New EventLog Try 'Register the App as an Event Source If Not objEventLog.SourceExists(AppName) Then objEventLog.CreateEventSource(AppName, LogName) End If objEventLog.Source = AppName 'WriteEntry is overloaded; this is one of 10 ways to call it objEventLog.WriteEntry(Entry, EventType) Return True Catch Ex As Exception Return False End Try End Function
- 01 Jul 2020
- 06 Apr 2020
- 11 Mar 2020
- 15 Feb 2020
- 02 Jan 2020
This site is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. We also participates in affiliate programs with Udemy, and other sites. This site is compensated for referring traffic and business to these companies.