Bagikan melalui


TextWriterTraceListener.Writer Properti

Definisi

Mendapatkan atau mengatur penulis teks yang menerima output penelusuran atau penelusuran kesalahan.

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

Nilai Properti

TextWriter yang mewakili penulis yang menerima output pelacakan atau penelusuran kesalahan.

Contoh

Contoh berikut membuat TextWriterTraceListener yang menulis ke layar konsol. Kemudian kode menambahkan pendengar pelacakan baru ke Listeners di kelas pelacakan.

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

Berlaku untuk

Lihat juga