DefaultTraceListener.WriteLine(String) Yöntem

Tanım

Çıkışı işleve OutputDebugString ve yöntemine Log(Int32, String, String) yazar, ardından bir satır başı ve satır beslemesi (\r\n).

public:
 override void WriteLine(System::String ^ message);
public override void WriteLine (string? message);
public override void WriteLine (string message);
override this.WriteLine : string -> unit
Public Overrides Sub WriteLine (message As String)

Parametreler

message
String

ve Log(Int32, String, String)öğesine yazacak OutputDebugString ileti.

Örnekler

Aşağıdaki kod örneği bir işlevin sonuçlarını biçimlendirip iletisinin WriteLine(String) son bölümünü öğesine DefaultTraceListeneryazmak için yöntemini kullanır.

// Compute the next binomial coefficient.
// If an exception is thrown, quit.
decimal result = CalcBinomial(possibilities, iter);
if (result==0) {return;}

// Format the trace and console output.
string binomial = String.Format("Binomial( {0}, {1} ) = ", possibilities, iter);
defaultListener.Write(binomial);
defaultListener.WriteLine(result.ToString());
Console.WriteLine("{0} {1}", binomial, result);
' Compute the next binomial coefficient.  
' If an exception is thrown, quit.
Dim result As Decimal = CalcBinomial(possibilities, iter)
If result = 0 Then Return

' Format the trace and console output.
Dim binomial As String = String.Format( _
        "Binomial( {0}, {1} ) = ", possibilities, iter)
defaultListener.Write(binomial)
defaultListener.WriteLine(result.ToString)
Console.WriteLine("{0} {1}", binomial, result)

Açıklamalar

Varsayılan satır sonlandırıcısı, satır beslemesi (\r\n) izleyen bir satır başıdır.

Win32 OutputDebugString hata ayıklama işlevi hakkında bilgi için bkz. Platform SDK'sı veya MSDN.

Bu yöntem özelliğini olarak NeedIndenttrueayarlar.

Şunlara uygulanır

Ayrıca bkz.