語言

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

適用於