共用方式為


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

屬性值

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如果值為零刻度,則不會 WebHeartbeatEvent 引發任何事件。

適用於