語言

HealthMonitoringSection.HeartbeatInterval 屬性

定義

取得或設定應用程式域在事件 WebHeartbeatEvent 中提出事件時所使用的區間。

public:
 property TimeSpan HeartbeatInterval { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsConverter))]
[System.Configuration.ConfigurationProperty("heartbeatInterval", DefaultValue="00:00:00")]
[System.Configuration.TimeSpanValidator(MaxValueString="24.20:31:23", MinValueString="00:00:00")]
public TimeSpan HeartbeatInterval { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsConverter))>]
[<System.Configuration.ConfigurationProperty("heartbeatInterval", DefaultValue="00:00:00")>]
[<System.Configuration.TimeSpanValidator(MaxValueString="24.20:31:23", MinValueString="00:00:00")>]
member this.HeartbeatInterval : TimeSpan with get, set
Public Property HeartbeatInterval As TimeSpan

屬性值

應用領域在提出 WebHeartbeatEvent 事件時所使用的區間。

屬性

範例

以下程式碼範例說明如何使用該 HeartbeatInterval 屬性。 此程式碼範例是本類別更大範例 HealthMonitoringSection 的一部分。


// Get the current HeartBeatInterval property value.
TimeSpan heartBeatIntervalValue = healthMonitoringSection.HeartbeatInterval;

// Set the HeartBeatInterval property to
// TimeSpan.Parse("00:10:00").
healthMonitoringSection.HeartbeatInterval = TimeSpan.Parse("00:10:00");

' Get the current HeartBeatInterval property value.
Dim heartBeatIntervalValue As TimeSpan = healthMonitoringSection.HeartbeatInterval

' Set the HeartBeatInterval property to
' TimeSpan.Parse("00:10:00").
healthMonitoringSection.HeartbeatInterval = TimeSpan.Parse("00:10:00")

備註

若 TimeSpan 值為零tick,則不會 WebHeartbeatEvent 觸發事件。

適用於