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 property is initialized to an empty string ("", or String.Empty).

The following 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
Available since 1.1
Return to top
Show: