下面的代码检查当前的 HTTP Handler 属性,以确定其是否需要对会话状态值具有读写访问权。

bool requiresSession = false;

if (Context.Handler is IRequiresSessionState)
  requiresSession = true;


下面的代码检查当前 HTTP Handler 属性来确定它是否只需要具有对会话状态值的读访问权限。

bool readOnlySession = false;

if (Context.Handler is IReadOnlySessionState)
  readOnlySession = true
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
猜你喜欢
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2021-07-26
相关资源
相似解决方案