共用方式為


SessionStateSection.StateNetworkTimeout 屬性

定義

取得或設定網頁伺服器與狀態伺服器間網路連線可保持閒置的時間。

public:
 property TimeSpan StateNetworkTimeout { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsOrInfiniteConverter))]
[System.Configuration.ConfigurationProperty("stateNetworkTimeout", DefaultValue="00:00:10")]
public TimeSpan StateNetworkTimeout { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsOrInfiniteConverter))>]
[<System.Configuration.ConfigurationProperty("stateNetworkTimeout", DefaultValue="00:00:10")>]
member this.StateNetworkTimeout : TimeSpan with get, set
Public Property StateNetworkTimeout As TimeSpan

屬性值

網路連線在放棄會話前能保持閒置的時間(以秒計)。 預設值為 10 秒。

屬性

範例

以下程式碼範例示範如何取得該 StateNetworkTimeout 財產。 參考課程主題中的 SessionStateSection 程式碼範例,學習如何存取該 SessionStateSection 物件。

// Display the current StateNetworkTimeout property value.
Console.WriteLine("StateNetworkTimeout: {0}",
  sessionStateSection.StateNetworkTimeout);
' Display the current StateNetworkTimeout property value.
Console.WriteLine("StateNetworkTimeout: {0}", _
  sessionStateSection.StateNetworkTimeout)

備註

sessionStateSection當屬性Mode被設定為 StateServer時,此屬性是必需的。

適用於