Export (0) Print
Expand All

TextWriterTraceListener Constructor

Initializes a new instance of the TextWriterTraceListener class with TextWriter as the output recipient.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)

new : unit -> TextWriterTraceListener

This constructor uses the TextWriter stream as the recipient of the tracing or debugging output. Its Name is initialized to "TextWriter".

The following code example creates a TextWriterTraceListener using the TextWriterTraceListener() constructor. It sets the Writer property to console output, and then adds the TextWriterTraceListener to the TraceListenerCollection. It writes a message in two segments, and then closes the TextWriterTraceListener.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
Show:
© 2015 Microsoft