ASP.NET再类中使用Application、Session、Server、Response、Request对象
在ASP.NET项目中,如果建立一个类,想在类中使用Application、Session、Server、Response、Request对象。
这五大对象是在 HttpContext 对象中。
代码示例如下:
HttpContext.Current.Application["administrator"]
HttpContext.Current.Session["ad"]
HttpContext.Current.Server
HttpContext.Current.Response
HttpContext.Current.Requst

浙公网安备 33010602011771号