Share via


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

适用于