【发布时间】:2011-08-10 15:19:21
【问题描述】:
我们目前使用这行代码在Application_Start事件中获取当前应用的url。
string sApplicationURL = HttpContext.Current.Request.Url.Scheme + "://"
+ HttpContext.Current.Request.Url.Authority
+ HttpContext.Current.Request.ApplicationPath;
我最近才发现,在 IIS7.0 中,当 Application_Start 事件被触发时,Request 对象不再可用。
有没有其他方法可以在不使用 Request 对象的情况下获取当前应用程序的 url?
谢谢
【问题讨论】: