如何存储Session
一般情况下,我们喜欢使用Session储存我们的变量。Asp.Net提供了下面一些方法储存Session的值:
(1)InProc
(2)StateServer
(3)SQLServer
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="1"
/>
(1)mode="InProc"进程内
(2)mode="StateServer"后stateConnectionString="tcpip=127.0.0.1:42424"有效,要启动状态服务
(3)mode="SQLServer "后sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"有效,要有数据库表。
(1)InProc
(2)StateServer
(3)SQLServer
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="1"
/>
(1)mode="InProc"进程内
(2)mode="StateServer"后stateConnectionString="tcpip=127.0.0.1:42424"有效,要启动状态服务
(3)mode="SQLServer "后sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"有效,要有数据库表。