HostingEnvironmentSection.IdleTimeout 属性

定义

获取或设置卸载非活动应用程序前的时间长度(以分钟为单位)。

C#
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanMinutesOrInfiniteConverter))]
[System.Configuration.ConfigurationProperty("idleTimeout", DefaultValue="10675199.02:48:05.4775807")]
[System.Configuration.TimeSpanValidator(MaxValueString="10675199.02:48:05.4775807", MinValueString="00:00:00")]
public TimeSpan IdleTimeout { get; set; }

属性值

一个 TimeSpan,它是指定的分钟数,在此时间之后将卸载非活动的应用程序。

属性

示例

下面的代码示例说明如何使用 IdleTimeout 属性。 此代码示例是为 HostingEnvironmentSection 类提供的一个更大示例的一部分。

C#
// Display IdleTimout property
Console.WriteLine("Idle Timeout: {0}", configSection.IdleTimeout);

注解

属性的 IdleTimeout 默认值为“Infinite”。 可以在计算机或应用程序级别设置此设置。 如果在任何其他级别定义此设置,则忽略该设置。

适用于

产品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1