HostingEnvironmentSection.IdleTimeout 属性
定义
获取或设置卸载非活动应用程序前的时间长度(以分钟为单位)。Gets or sets the amount of time, in minutes, before unloading an inactive application.
public:
property TimeSpan IdleTimeout { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanMinutesOrInfiniteConverter))]
[System.Configuration.ConfigurationProperty("idleTimeout", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
[System.Configuration.TimeSpanValidator(MaxValueString="10675199.02:48:05.4775807", MinValueString="00:00:00")]
public TimeSpan IdleTimeout { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanMinutesOrInfiniteConverter))>]
[<System.Configuration.ConfigurationProperty("idleTimeout", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
[<System.Configuration.TimeSpanValidator(MaxValueString="10675199.02:48:05.4775807", MinValueString="00:00:00")>]
member this.IdleTimeout : TimeSpan with get, set
Public Property IdleTimeout As TimeSpan
属性值
一个 TimeSpan,它是指定的分钟数,在此时间之后将卸载非活动的应用程序。A TimeSpan that is the specified number of minutes before unloading an inactive application.
- 属性
示例
下面的代码示例说明如何使用 IdleTimeout 属性。The following code example shows how to use the IdleTimeout property. 此代码示例是为类提供的更大示例的一部分 HostingEnvironmentSection 。This code example is part of a larger example provided for the HostingEnvironmentSection class.
// Display IdleTimout property
Console.WriteLine("Idle Timeout: {0}", configSection.IdleTimeout);
' Display the IdleTimout property
Console.WriteLine("Idle Timeout: {0}", configSection.IdleTimeout)
注解
属性的默认值 IdleTimeout 为 "无限"。The default value for the IdleTimeout property is "Infinite". 此设置可在计算机或应用程序级别设置。This setting can be set at the machine or application level. 如果在任何其他级别定义此设置,则将忽略此设置。If this setting is defined at any other level, it is ignored.