共用方式為


SessionStateSection.StateNetworkTimeout 屬性

定義

取得或設定 Web 伺服器和狀態伺服器之間,網路連接可以維持閒置的時間長度。

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

屬性值

TimeSpan

在 Web 伺服器和狀態伺服器之間,網路連接可在放棄工作階段之前維持閒置的時間,以秒為單位。 預設值為 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)

備註

當 屬性設定為 StateServerMode ,需要這個 sessionStateSection 屬性。

適用於