EventLogSession.ExportLogAndMessages EventLogSession.ExportLogAndMessages EventLogSession.ExportLogAndMessages Method

定義

將事件和其訊息匯出至外部記錄檔。Exports events and their messages into an external log file.

多載

ExportLogAndMessages(String, PathType, String, String) ExportLogAndMessages(String, PathType, String, String) ExportLogAndMessages(String, PathType, String, String)

將事件和其訊息匯出至外部記錄檔。Exports events and their messages into an external log file.

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

將事件和其訊息匯出至外部記錄檔。Exports events and their messages into an external log file. 可以設定旗標以指出方法將會繼續匯出事件,即使指定的查詢針對部分記錄發生失敗。A flag can be set to indicate that the method will continue exporting events even if the specified query fails for some logs. 事件訊息會以指定的語言匯出。The event messages are exported in the specified language.

ExportLogAndMessages(String, PathType, String, String) ExportLogAndMessages(String, PathType, String, String) ExportLogAndMessages(String, PathType, String, String)

將事件和其訊息匯出至外部記錄檔。Exports events and their messages into an external log file.

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

參數

path
String String String

要匯出事件的事件記錄名稱或事件記錄檔路徑。The name of the event log to export events from, or the path to the event log file to export events from.

pathType
PathType PathType PathType

指定用於路徑參數的字串是否會指定事件記錄名稱或事件記錄檔路徑。Specifies whether the string used in the path parameter specifies the name of an event log, or the path to an event log file.

query
String String String

用來選取要匯出之事件的查詢。The query used to select the events to export. 系統只會匯出由查詢傳回的事件。Only the events returned from the query will be exported.

targetFilePath
String String String

在執行此方法後將儲存已匯出事件的記錄檔 (以 .evtx 為結尾) 路徑。The path to the log file (ends in .evtx) in which the exported events will be stored after this method is executed.

範例

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

備註

事件訊息會以預設語言匯出。The event messages are exported in the default language.

另請參閱

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

將事件和其訊息匯出至外部記錄檔。Exports events and their messages into an external log file. 可以設定旗標以指出方法將會繼續匯出事件,即使指定的查詢針對部分記錄發生失敗。A flag can be set to indicate that the method will continue exporting events even if the specified query fails for some logs. 事件訊息會以指定的語言匯出。The event messages are exported in the specified language.

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

參數

path
String String String

要匯出事件的事件記錄名稱或事件記錄檔路徑。The name of the event log to export events from, or the path to the event log file to export events from.

pathType
PathType PathType PathType

指定用於路徑參數的字串是否會指定事件記錄名稱或事件記錄檔路徑。Specifies whether the string used in the path parameter specifies the name of an event log, or the path to an event log file.

query
String String String

用來選取要匯出之事件的查詢。The query used to select the events to export. 系統只會匯出由查詢傳回的事件。Only the events returned from the query will be exported.

targetFilePath
String String String

在執行此方法後將儲存已匯出事件的記錄檔 (以 .evtx 為結尾) 路徑。The path to the log file (ends in .evtx) in which the exported events will be stored after this method is executed.

tolerateQueryErrors
Boolean Boolean Boolean

true 指出方法將會繼續匯出事件,即使指定的查詢針對部分記錄發生失敗,而 false 則指出此方法在指定的查詢失敗時將不會繼續匯出事件。true indicates that the method will continue exporting events even if the specified query fails for some logs, and false indicates that this method will not continue to export events when the specified query fails.

targetCultureInfo
CultureInfo CultureInfo CultureInfo

指定匯出事件訊息之語言的文化特性。The culture that specifies which language that the exported event messages will be in.

範例

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

另請參閱

適用於