EventLogSession.ClearLog EventLogSession.ClearLog EventLogSession.ClearLog EventLogSession.ClearLog Method

定義

從指定的事件記錄檔清除事件。Clears events from the specified event log.

多載

ClearLog(String) ClearLog(String) ClearLog(String) ClearLog(String)

從指定的事件記錄檔清除事件。Clears events from the specified event log.

ClearLog(String, String) ClearLog(String, String) ClearLog(String, String) ClearLog(String, String)

從指定的事件記錄檔中清除事件,並將已清除的事件儲存至指定的檔案。Clears events from the specified event log, and saves the cleared events to the specified file.

範例

例如程式碼使用這個類別中,請參閱How To:匯出、 封存和清除事件記錄檔For example code using this class, see How To: Export, Archive, and Clear Event Logs.

ClearLog(String) ClearLog(String) ClearLog(String) ClearLog(String)

從指定的事件記錄檔清除事件。Clears events from the specified event log.

public:
 void ClearLog(System::String ^ logName);
public void ClearLog (string logName);
member this.ClearLog : string -> unit
Public Sub ClearLog (logName As String)

參數

logName
String String String String

要從中清除所有事件的事件記錄檔名稱。The name of the event log to clear all the events from.

範例

例如程式碼使用這個類別中,請參閱How To:匯出、 封存和清除事件記錄檔For example code using this class, see How To: Export, Archive, and Clear Event Logs.

另請參閱

ClearLog(String, String) ClearLog(String, String) ClearLog(String, String) ClearLog(String, String)

從指定的事件記錄檔中清除事件,並將已清除的事件儲存至指定的檔案。Clears events from the specified event log, and saves the cleared events to the specified file.

public:
 void ClearLog(System::String ^ logName, System::String ^ backupPath);
public void ClearLog (string logName, string backupPath);
member this.ClearLog : string * string -> unit
Public Sub ClearLog (logName As String, backupPath As String)

參數

logName
String String String String

要從中清除所有事件的事件記錄檔名稱。The name of the event log to clear all the events from.

backupPath
String String String String

將儲存已清除事件之檔案的路徑。The path to the file in which the cleared events will be saved. 檔案的副檔名必須是 .evtx。The file should end in .evtx.

範例

例如程式碼使用這個類別中,請參閱How To:匯出、 封存和清除事件記錄檔For example code using this class, see How To: Export, Archive, and Clear Event Logs.

另請參閱

適用於