共用方式為


SessionStateSection.Mode 屬性

定義

取得或設定一個值,指定會話狀態的儲存位置。

public:
 property System::Web::SessionState::SessionStateMode Mode { System::Web::SessionState::SessionStateMode get(); void set(System::Web::SessionState::SessionStateMode value); };
[System.Configuration.ConfigurationProperty("mode", DefaultValue=System.Web.SessionState.SessionStateMode.InProc)]
public System.Web.SessionState.SessionStateMode Mode { get; set; }
[<System.Configuration.ConfigurationProperty("mode", DefaultValue=System.Web.SessionState.SessionStateMode.InProc)>]
member this.Mode : System.Web.SessionState.SessionStateMode with get, set
Public Property Mode As SessionStateMode

屬性值

這是其中一項 SessionStateMode 價值。 預設值為 InProc

屬性

範例

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

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

備註

SessionStateMode 不是必須的屬性,可以從組態階層的更高層級繼承,或是從預設值繼承。 然而,該區段的設定處理器在撰寫此區段時,會根據當前繼承值寫出模式。

適用於