有以下方法:
主要是方式就是通过context获取HttpApplication,然后通过Application获取相应的HttpContext
①HttpContext context=HttpContextBase.ApplicationInstance.Context
②HttpContext context=((HttpApplication)HttpContext.GetService(typeof(HttpApplication))).Context;
有以下方法:
主要是方式就是通过context获取HttpApplication,然后通过Application获取相应的HttpContext
①HttpContext context=HttpContextBase.ApplicationInstance.Context
②HttpContext context=((HttpApplication)HttpContext.GetService(typeof(HttpApplication))).Context;