语言

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

适用于