语言

HealthMonitoringSection.Enabled 属性

定义

获取或设置一个值,该值指示是否启用运行状况监视。

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

属性值

true 如果启用了运行状况监视,则为否则,为 false. 默认值为 true。

属性

示例

下面的代码示例演示如何从 Enabled 属性获取当前值,以及如何通过将此属性设置为值 false来禁用运行状况监视。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。


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

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

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

' Set the Enabled property to False.
healthMonitoringSection.Enabled = False

适用于