共用方式為


HostingEnvironmentSection.ShutdownTimeout 屬性

定義

取得或設定適當關閉應用程式的時間長度,以秒為單位。

public:
 property TimeSpan ShutdownTimeout { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsConverter))]
[System.Configuration.ConfigurationProperty("shutdownTimeout", DefaultValue="00:00:30")]
[System.Configuration.TimeSpanValidator(MaxValueString="10675199.02:48:05.4775807", MinValueString="00:00:00")]
public TimeSpan ShutdownTimeout { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsConverter))>]
[<System.Configuration.ConfigurationProperty("shutdownTimeout", DefaultValue="00:00:30")>]
[<System.Configuration.TimeSpanValidator(MaxValueString="10675199.02:48:05.4775807", MinValueString="00:00:00")>]
member this.ShutdownTimeout : TimeSpan with get, set
Public Property ShutdownTimeout As TimeSpan

屬性值

TimeSpan 是適當關閉應用程式的指定秒數。 預設值為 30 秒。

屬性

範例

下列程式碼範例示範如何使用 ShutdownTimeout 屬性。 此程式碼範例是針對 類別提供的較大範例的 HostingEnvironmentSection 一部分。

// Display ShutdownTimeout property
Console.WriteLine("Shutdown Timeout: {0}", configSection.ShutdownTimeout);
' Display the ShutdownTimeout property
Console.WriteLine("Shutdown Timeout: {0}", configSection.ShutdownTimeout)

備註

屬性的 ShutdownTimeout 預設值為 30 秒。 此設定可以在電腦或應用層級設定。 如果此設定是在任何其他組態層級定義,則會忽略此設定。 如果偵錯工具附加至應用程式,應用程式將不會關閉。

適用於