Removes a log resource.
Removes an event log from the specified computer.
[Visual Basic] Overloads Public Shared Sub Delete(String, String)
[C#] public static void Delete(String, String);
[C++] public: static void Delete(String*, String*);
[JScript] public static function Delete(String, String);
Removes an event log from the local computer.
[Visual Basic] Overloads Public Shared Sub Delete(String)
[C#] public static void Delete(String);
[C++] public: static void Delete(String*);
[JScript] public static function Delete(String);
The following example deletes a log from the local computer. The example verifies whether "myLog" exists on the local computer before removing the log.
Import the System.Diagnostics namespace for this example.
Note This example shows how to use one of the overloaded versions of Delete. For other examples that may be available, see the individual overload topics.
[Visual Basic]
Private Sub DeleteLog() 'Declare an event log name Dim eventLogName As String eventLogName = "myLog" 'If the event log passed in exists on the server, delete it. If EventLog.Exists(eventLogName) Then EventLog.Delete(eventLogName) End If End Sub
EventLog Class | EventLog Members | System.Diagnostics Namespace