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

属性值

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

适用于