ConsoleTraceListener コンストラクタ ()
アセンブリ: System (system.dll 内)
構文
解説
このコンストラクタは ConsoleTraceListener オブジェクトを初期化して、メッセージを Console.Out ストリームに書き込みます。Name プロパティは、空の文字列 ("") に初期化されます。
指定された Console 出力ストリームの ConsoleTraceListener オブジェクトを初期化して、トレース リスナ コレクションに追加するコード例を次に示します。このコード例は、ConsoleTraceListener クラスのトピックで取り上げているコード例の一部分です。
' Define a trace listener to direct trace output from this method ' to the console. Dim consoleTracer As ConsoleTraceListener ' Check the command line arguments to determine which ' console stream should be used for trace output. If (CmdArgs.Length > 0) AndAlso _ (CmdArgs(0).ToLower.Equals("/stderr")) Then ' Initialize the console trace listener to write ' trace output to the standard error stream. consoleTracer = New ConsoleTraceListener(True) Else ' Initialize the console trace listener to write ' trace output to the standard output stream. consoleTracer = New ConsoleTraceListener End If ' Set the name of the trace listener, which helps identify this ' particular instance within the trace listener collection. consoleTracer.Name = "mainConsoleTracer" ' Write the initial trace message to the console trace listener. consoleTracer.WriteLine(DateTime.Now.ToString() & " [" & _ consoleTracer.Name & "] - Starting output to trace listener.") ' Add the new console trace listener to ' the collection of trace listeners. Trace.Listeners.Add(consoleTracer)
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
ConsoleTraceListener コンストラクタ (Boolean)
アセンブリ: System (system.dll 内)
構文
解説
このコンストラクタは、ConsoleTraceListener オブジェクトを初期化して、メッセージを Console.Out または Console.Error ストリームに書き込みます。Name プロパティは、空の文字列 ("") に初期化されます。
指定された Console 出力ストリームの ConsoleTraceListener オブジェクトを初期化して、トレース リスナ コレクションに追加するコード例を次に示します。このコード例は、ConsoleTraceListener クラスのトピックで取り上げているコード例の一部分です。
' Define a trace listener to direct trace output from this method ' to the console. Dim consoleTracer As ConsoleTraceListener ' Check the command line arguments to determine which ' console stream should be used for trace output. If (CmdArgs.Length > 0) AndAlso _ (CmdArgs(0).ToLower.Equals("/stderr")) Then ' Initialize the console trace listener to write ' trace output to the standard error stream. consoleTracer = New ConsoleTraceListener(True) Else ' Initialize the console trace listener to write ' trace output to the standard output stream. consoleTracer = New ConsoleTraceListener End If ' Set the name of the trace listener, which helps identify this ' particular instance within the trace listener collection. consoleTracer.Name = "mainConsoleTracer" ' Write the initial trace message to the console trace listener. consoleTracer.WriteLine(DateTime.Now.ToString() & " [" & _ consoleTracer.Name & "] - Starting output to trace listener.") ' Add the new console trace listener to ' the collection of trace listeners. Trace.Listeners.Add(consoleTracer)
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
ConsoleTraceListener コンストラクタ
- ConsoleTraceListener コンストラクタ ()のページへのリンク