EventLogSession.ExportLogAndMessages 方法

定義

將事件和其訊息匯出至外部記錄檔。

多載

ExportLogAndMessages(String, PathType, String, String)

將事件和其訊息匯出至外部記錄檔。

ExportLogAndMessages(String, PathType, String, String, Boolean, CultureInfo)

將事件和其訊息匯出至外部記錄檔。 可以設定旗標以指出方法將會繼續匯出事件,即使指定的查詢針對部分記錄發生失敗。 事件訊息會以指定的語言匯出。

ExportLogAndMessages(String, PathType, String, String)

來源:
EventLogSession.cs
來源:
EventLogSession.cs
來源:
EventLogSession.cs

將事件和其訊息匯出至外部記錄檔。

public:
 void ExportLogAndMessages(System::String ^ path, System::Diagnostics::Eventing::Reader::PathType pathType, System::String ^ query, System::String ^ targetFilePath);
public void ExportLogAndMessages (string path, System.Diagnostics.Eventing.Reader.PathType pathType, string query, string targetFilePath);
member this.ExportLogAndMessages : string * System.Diagnostics.Eventing.Reader.PathType * string * string -> unit
Public Sub ExportLogAndMessages (path As String, pathType As PathType, query As String, targetFilePath As String)

參數

path
String

要匯出事件的事件記錄名稱或事件記錄檔路徑。

pathType
PathType

指定用於路徑參數的字串是否會指定事件記錄名稱或事件記錄檔路徑。

query
String

用來選取要匯出之事件的查詢。 系統只會匯出由查詢傳回的事件。

targetFilePath
String

在執行此方法後將儲存已匯出事件的記錄檔 (以 .evtx 為結尾) 路徑。

範例

如需使用此類別的範例程式代碼,請參閱 如何:匯出、封存和清除事件記錄檔。

備註

事件訊息會以預設語言導出。

另請參閱

適用於

ExportLogAndMessages(String, PathType, String, String, Boolean, CultureInfo)

來源:
EventLogSession.cs
來源:
EventLogSession.cs
來源:
EventLogSession.cs

將事件和其訊息匯出至外部記錄檔。 可以設定旗標以指出方法將會繼續匯出事件,即使指定的查詢針對部分記錄發生失敗。 事件訊息會以指定的語言匯出。

public:
 void ExportLogAndMessages(System::String ^ path, System::Diagnostics::Eventing::Reader::PathType pathType, System::String ^ query, System::String ^ targetFilePath, bool tolerateQueryErrors, System::Globalization::CultureInfo ^ targetCultureInfo);
public void ExportLogAndMessages (string path, System.Diagnostics.Eventing.Reader.PathType pathType, string query, string targetFilePath, bool tolerateQueryErrors, System.Globalization.CultureInfo targetCultureInfo);
member this.ExportLogAndMessages : string * System.Diagnostics.Eventing.Reader.PathType * string * string * bool * System.Globalization.CultureInfo -> unit
Public Sub ExportLogAndMessages (path As String, pathType As PathType, query As String, targetFilePath As String, tolerateQueryErrors As Boolean, targetCultureInfo As CultureInfo)

參數

path
String

要匯出事件的事件記錄名稱或事件記錄檔路徑。

pathType
PathType

指定用於路徑參數的字串是否會指定事件記錄名稱或事件記錄檔路徑。

query
String

用來選取要匯出之事件的查詢。 系統只會匯出由查詢傳回的事件。

targetFilePath
String

在執行此方法後將儲存已匯出事件的記錄檔 (以 .evtx 為結尾) 路徑。

tolerateQueryErrors
Boolean

true 指出方法將會繼續匯出事件,即使指定的查詢針對部分記錄發生失敗,而 false 則指出此方法在指定的查詢失敗時將不會繼續匯出事件。

targetCultureInfo
CultureInfo

指定匯出事件訊息之語言的文化特性。

範例

如需使用此類別的範例程式代碼,請參閱 如何:匯出、封存和清除事件記錄檔。

另請參閱

適用於