在 [WebMethod]中取Seesion值的方法:
把Session[“xx_user”]替换为HttpContext.Current.Session[“xx_user”]即可,HttpContext.Current.Session 和 Session 的区别
他们具有相同的作用,他们将会访问相同的session数据。
如:string czy_str =HttpContext.Current.Session[“xx_user”].ToString().Trim();
在 [WebMethod]中取Seesion值的方法
最新推荐文章于 2025-08-09 11:01:34 发布
本文介绍了在ASP.NET中如何使用HttpContext.Current.Session替代Session对象来获取Session值,两者访问相同的session数据,通过示例代码展示了具体操作。
2525

被折叠的 条评论
为什么被折叠?



