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