Read / Write information to the Windows XP / 2000 / NT (?) Event Log (Admin Tools item > Event Log)
This simple code will write to the windows Event Logger, which can be read by going into Control Panel > Admin Tools > Event Logger. Useful for diagnostics after compile time, when you have no debug window. YOU NEED TO ADD THE 'EVENT LOG' CONTROL FROM THE 'COMPONENTS' MENU TO YOUR FORM!
AI
Resumen de IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Código fuente
'ADD AN EVENTLOG TO YOUR FORM!
Dim Log As New EventLog()
'======== Adds an entry ========
Log.WriteEntry("Program Name", "Text you wish to add to the log, write here", EventLogEntryType.Error, "1", "1")
'======== Deletes entry ===
log.Delete("Program Name")
'===== Search for entry ===
Dim r as boolean
r = log.Exists("Name of program")
'r will return true, or false
'==== Get all entries ==
Dim r As Array
r = log.GetEventLogs()
'r is now an array containing all the entries of the log.
tHe_cLeanER
Comentarios originales (3)
Recuperado de Wayback Machine