NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

EventLog.Delete

Removes a log resource.

Overload List

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);

Example [Visual Basic]

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

See Also

EventLog Class | EventLog Members | System.Diagnostics Namespace