This documentation is archived and is not being maintained.

TextWriterTraceListener.Writer Property

Gets or sets the text writer that receives the tracing or debugging output.

[Visual Basic]
Public Property Writer As TextWriter
public TextWriter Writer {get; set;}
public: __property TextWriter* get_Writer();
public: __property void set_Writer(TextWriter*);
public function get Writer() : TextWriter;
public function set Writer(TextWriter);

Property Value

A TextWriter that represents the writer that receives the tracing or debugging output.


[Visual Basic, C#, C++] The following example creates a TextWriterTraceListener that writes to the console screen. Then the code adds the new trace listener to the Listeners in the trace class.

[Visual Basic] 
Dim myWriter As New TextWriterTraceListener()
myWriter.Writer = System.Console.Out


 TextWriterTraceListener myWriter = new TextWriterTraceListener();
    myWriter.Writer = System.Console.Out;


 TextWriterTraceListener* myWriter = new TextWriterTraceListener();
    myWriter->Writer = System::Console::Out;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

TextWriterTraceListener Class | TextWriterTraceListener Members | System.Diagnostics Namespace | TraceListener | DefaultTraceListener | EventLogTraceListener | TextWriterTraceListener | Stream | TextWriter | Debug | Trace