HttpSessionState.Mode 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取当前会话状态模式。
public:
property System::Web::SessionState::SessionStateMode Mode { System::Web::SessionState::SessionStateMode get(); };
public System.Web.SessionState.SessionStateMode Mode { get; }
member this.Mode : System.Web.SessionState.SessionStateMode
Public ReadOnly Property Mode As SessionStateMode
属性值
SessionStateMode 值之一。
示例
下面的代码示例将 mode
会话属性设置为 SQLServer Web.config文件中。 对于SQL Server会话模式,还需要该sqlConnectionString
属性。
<configuration>
<system.web>
<sessionState
mode="SQLServer"
sqlConnectionString="Data Source=localhost;Integrated Security=SSPI"
cookieless="true"
timeout="30" />
</system.web>
</configuration>
注解
有关如何配置StateServer服务器或SQLServer会话状态存储的信息,请参阅 ASP.NET 会话状态概述。