只要得到当前Http请求的句柄,即HttpContext就可以了。
HttpContext类有一静态方法HttpContext.Current用来获得当前httpContext实例在你的自定义类里就可以像在页面里一样使用了
HttpContext.Current.Request
HttpContext.Current.Response
HttpContext.Current.Session
HttpContext.Current.Server
HttpContext类有一静态方法HttpContext.Current用来获得当前httpContext实例在你的自定义类里就可以像在页面里一样使用了
HttpContext.Current.Request
HttpContext.Current.Response
HttpContext.Current.Session
HttpContext.Current.Server
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货