TextWriterTraceListener.Writer 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取行或設定接收追蹤或偵錯之輸出的文字寫入器。
public:
property System::IO::TextWriter ^ Writer { System::IO::TextWriter ^ get(); void set(System::IO::TextWriter ^ value); };
public System.IO.TextWriter? Writer { get; set; }
public System.IO.TextWriter Writer { get; set; }
member this.Writer : System.IO.TextWriter with get, set
Public Property Writer As TextWriter
屬性值
TextWriter,表示接收追蹤或偵錯之輸出的寫入器。
範例
下列範例會 TextWriterTraceListener 建立寫入主控台畫面的 。 然後程式代碼會將新的追蹤接聽程式新增至 Listeners 追蹤類別中的 。
#if defined(TRACE)
TextWriterTraceListener^ myWriter = gcnew TextWriterTraceListener;
myWriter->Writer = System::Console::Out;
Trace::Listeners->Add( myWriter );
#endif
TextWriterTraceListener myWriter = new TextWriterTraceListener();
myWriter.Writer = System.Console.Out;
Trace.Listeners.Add(myWriter);
Dim myWriter As New TextWriterTraceListener()
myWriter.Writer = System.Console.Out
Trace.Listeners.Add(myWriter)