語言

TraceSection.WriteToDiagnosticsTrace 屬性

定義

會取得或設定一個值,表示透過頁面追蹤發出的訊息是否會轉發到該 Trace 類別的實例。

public:
 property bool WriteToDiagnosticsTrace { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("writeToDiagnosticsTrace", DefaultValue=false)]
public bool WriteToDiagnosticsTrace { get; set; }
[<System.Configuration.ConfigurationProperty("writeToDiagnosticsTrace", DefaultValue=false)>]
member this.WriteToDiagnosticsTrace : bool with get, set
Public Property WriteToDiagnosticsTrace As Boolean

屬性值

true 如果追蹤訊息被傳送到類別; Trace 否則, false。 預設值為 false。

屬性

範例

以下程式碼範例說明如何使用該 WriteToDiagnosticsTrace 屬性。 此程式碼範例是本類別更大範例 TraceSection 的一部分。


// Get the current WriteToDiagnosticsTrace property value.
Boolean writeToDiagnosticsTraceValue = traceSection.WriteToDiagnosticsTrace;

// Set the WriteToDiagnosticsTrace property to true.
traceSection.WriteToDiagnosticsTrace = true;

' Get the current WriteToDiagnosticsTrace property value.
Dim writeToDiagnosticsTraceValue As Boolean = traceSection.WriteToDiagnosticsTrace

' Set the WriteToDiagnosticsTrace property to true.
traceSection.WriteToDiagnosticsTrace = True

適用於