TraceSource.TraceInformation TraceSource.TraceInformation TraceSource.TraceInformation TraceSource.TraceInformation Method

定義

將告知性訊息寫入 Listeners 集合中的追蹤接聽程式。Writes an informational message to the trace listeners in the Listeners collection.

多載

TraceInformation(String) TraceInformation(String) TraceInformation(String) TraceInformation(String)

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

TraceInformation(String, Object[]) TraceInformation(String, Object[]) TraceInformation(String, Object[]) TraceInformation(String, Object[])

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

TraceInformation(String) TraceInformation(String) TraceInformation(String) TraceInformation(String)

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

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

參數

message
String String String String

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

例外狀況

嘗試在最終處理期間追蹤事件。An attempt was made to trace an event during finalization.

備註

TraceInformation方法提供的參考訊息可供使用者讀取,而不是工具。The TraceInformation method provides an informational message intended to be read by users and not by tools.

TraceInformation(String)呼叫方法,並將eventType設定TraceEventType.Information為,並將資訊訊息當做訊息字串傳遞。 TraceEvent(TraceEventType, Int32, String)TraceInformation(String) calls the TraceEvent(TraceEventType, Int32, String) method, setting eventType to TraceEventType.Information and passing the informative message as the message string. 方法接著會呼叫每個TraceEvent(TraceEventCache, String, TraceEventType, Int32, String)追蹤接聽項的方法。 TraceEvent(TraceEventType, Int32, String)The TraceEvent(TraceEventType, Int32, String) method in turn calls the TraceEvent(TraceEventCache, String, TraceEventType, Int32, String) method of each trace listener.

TraceInformation(String, Object[]) TraceInformation(String, Object[]) TraceInformation(String, Object[]) TraceInformation(String, Object[])

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

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

參數

format
String String String String

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

args
Object[]

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

例外狀況

format 無效。format is invalid.

-或--or- 用來指示要格式化的引數的數目小於零,或者大於或等於要格式化的指定物件數目。The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format.

嘗試在最終處理期間追蹤事件。An attempt was made to trace an event during finalization.

備註

如需參數的format詳細資訊,請參閱複合格式For more information about the format parameter, see Composite Formatting.

TraceInformation方法提供的參考訊息可供使用者讀取,而不是工具。The TraceInformation method provides an informational message intended to be read by users and not by tools.

TraceInformation(String, Object[])呼叫方法,並將eventType設定TraceEventType.Information為,並將訊息內容當做具有格式資訊的物件陣列傳遞。 TraceEvent(TraceEventType, Int32, String, Object[])TraceInformation(String, Object[]) calls the TraceEvent(TraceEventType, Int32, String, Object[]) method, setting eventType to TraceEventType.Information and passing the message content as an object array with formatting information. 方法接著會呼叫每個TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[])追蹤接聽項的方法。 TraceEvent(TraceEventType, Int32, String, Object[])The TraceEvent(TraceEventType, Int32, String, Object[]) method in turn calls the TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[]) method of each trace listener.

另請參閱

適用於