我们目前使用这行代码来获取Application_Start事件中的当前应用程序URL.
string sApplicationURL = HttpContext.Current.Request.Url.Scheme + "://"
+ HttpContext.Current.Request.Url.Authority
+ HttpContext.Current.Request.ApplicationPath;
Run Code Online (Sandbox Code Playgroud)
我刚刚发现,在IIS7.0中,当触发Application_Start事件时,Request对象不再可用.
有没有另一种方法来获取当前的应用程序URL而不使用Request对象?
谢谢