Trace.TraceError 方法

定義

將錯誤訊息寫入 Listeners 集合中的追蹤接聽項。Writes error information to the trace listeners in the Listeners collection.

多載

TraceError(String)

使用指定的訊息,將錯誤訊息寫入 Listeners 集合中的追蹤接聽程式。Writes an error message to the trace listeners in the Listeners collection using the specified message.

TraceError(String, Object[])

使用指定的物件陣列和格式化資訊,將錯誤訊息寫入 Listeners 集合中的追蹤接聽程式。Writes an error message to the trace listeners in the Listeners collection using the specified array of objects and formatting information.

TraceError(String)

使用指定的訊息,將錯誤訊息寫入 Listeners 集合中的追蹤接聽程式。Writes an error message to the trace listeners in the Listeners collection using the specified message.

public:
 static void TraceError(System::String ^ message);
[System.Diagnostics.Conditional("TRACE")]
public static void TraceError (string message);
static member TraceError : string -> unit
Public Shared Sub TraceError (message As String)

參數

message
String

要寫入的資訊訊息。The informative message to write.

屬性

備註

TraceError針對每個追蹤接聽程式呼叫Error方法,並以追蹤事件種類傳遞訊息字串形式的資訊訊息。TraceEventTraceError calls the TraceEvent method for each trace listener, with the trace event type Error, passing the informative message as the message string.

另請參閱

TraceError(String, Object[])

使用指定的物件陣列和格式化資訊,將錯誤訊息寫入 Listeners 集合中的追蹤接聽程式。Writes an error message to the trace listeners in the Listeners collection using the specified array of objects and formatting information.

public:
 static void TraceError(System::String ^ format, ... cli::array <System::Object ^> ^ args);
[System.Diagnostics.Conditional("TRACE")]
public static void TraceError (string format, params object[] args);
static member TraceError : string * obj[] -> unit
Public Shared Sub TraceError (format As String, ParamArray args As Object())

參數

format
String

包含零或多個格式項目的格式字串,其與 args 陣列中的物件相對應。A format string that contains zero or more format items, which correspond to objects in the args array.

args
Object[]

object 陣列,含有零或多個要格式化的物件。An object array containing zero or more objects to format.

屬性

備註

TraceError使用追蹤TraceEvent事件種類Error呼叫追蹤接聽程式中的方法, 並傳遞訊息內容做為具有格式資訊的物件陣列。TraceError calls the TraceEvent methods in the trace listeners with the trace event type Error, passing the message content as an object array with formatting information. 如需format和參數的詳細資訊, args請參閱方法。FormatSee the Format method for more information about the format and args parameters.

另請參閱

適用於