asp.net正常处理程序中使用session

asp.net一般处理程序中使用session一般处理程序中默认无法使用session使用session 需要引入System.Web.Ses

asp.net一般处理程序中使用session

一般处理程序中默认无法使用session

使用session 需要引入System.Web.SessionState命名空间

并实现 IRequiresSessionState接口

调用时如下

System.Web.HttpContext.Current.Session["username"] = str_username;