TextWriterTraceListener.Writer TextWriterTraceListener.Writer TextWriterTraceListener.Writer TextWriterTraceListener.Writer Property

定義

トレース出力またはデバッグ出力を受信するテキスト ライターを取得または設定します。Gets or sets the text writer that receives the tracing or debugging output.

public:
 property System::IO::TextWriter ^ Writer { System::IO::TextWriter ^ get(); void set(System::IO::TextWriter ^ value); };
public System.IO.TextWriter Writer { get; set; }
member this.Writer : System.IO.TextWriter with get, set
Public Property Writer As TextWriter

プロパティ値

トレース出力またはデバッグ出力を受信するライターを表す TextWriterA TextWriter that represents the writer that receives the tracing or debugging output.

次の例ではTextWriterTraceListener 、コンソール画面に書き込むを作成します。The following example creates a TextWriterTraceListener that writes to the console screen. 次に、トレースクラスのに新しいトレースリスナー Listenersを追加します。Then the code adds the new trace listener to the Listeners in the trace class.

#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)

適用対象

こちらもご覧ください