TraceSection.Enabled 属性

定义

获取或设置一个值,该值指示是否启用 ASP.NET 跟踪服务。

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

属性值

Boolean

如果启用跟踪,则为 true;否则为 false。 默认值为 true

属性

示例

下面的代码示例说明如何使用 Enabled 属性。 此代码示例是为 TraceSection 类提供的一个更大示例的一部分。


// Get the current Enabled property value.
Boolean enabledValue = traceSection.Enabled;

// Set the Enabled property to false.
traceSection.Enabled = false;

' Get the current Enabled property value.
Dim enabledValue As Boolean = traceSection.Enabled

' Set the Enabled property to false.
traceSection.Enabled = False

适用于

另请参阅