共用方式為


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

屬性值

如果追蹤訊息會傳送給 Trace 類別,則為 true,否則為 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

適用於