有以下方法:
主要是方式就是通过context获取HttpApplication,然后通过Application获取相应的HttpContext
①HttpContext context=HttpContextBase.ApplicationInstance.Context
②HttpContext context=((HttpApplication)HttpContext.GetService(typeof(HttpApplication))).Context;
Powered by: 博客园 Copyright © 2024 itboy2009 Powered by .NET 9.0 on Kubernetes