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

posted @ 2012-11-24 09:59  翱翔软件  阅读(229)  评论(0)    收藏  举报

欢迎访问翱翔软件