在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
复制代码 代码如下: public static string GetRootURI() { string AppPath = ""; HttpContext HttpCurrent = HttpContext.Current; HttpRequest Req; if (HttpCurrent != null) { Req = HttpCurrent.Request; string UrlAuthority = Req.Url.GetLeftPart(UriPartial.Authority); if (Req.ApplicationPath == null || Req.ApplicationPath == "/") //直接安装在 Web 站点 AppPath = UrlAuthority; else //安装在虚拟子目录下 AppPath = UrlAuthority + Req.ApplicationPath; } return AppPath; } |
请发表评论