1 引用这个命名空间

using System.Web.SessionState;

2 实现这两个接口中的任何一个

IReadOnlySessionState   //此接口只能使用session,无法修改session

IRequiresSessionState    //此接口可以使用session,也可以修改session

3 使用session

context.Session["user"]

HttpContext.Current.Session["user"]

 

相关文章:

  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-25
  • 2021-12-11
  • 2021-07-31
  • 2021-08-30
  • 2021-12-13
相关资源
相似解决方案