获取应用程序根路径
public string GetRootURI()
??????? {
??????????? string UrlAuthority = Request.Url.GetLeftPart(UriPartial.Authority);
??????????? if (Request.ApplicationPath == null || Request.ApplicationPath == "/")
??????????? {
??????????????? //直接安裝在Web站點
??????????????? return UrlAuthority;
??????????? }
??????????? else
??????????? {
??????????????? //安裝在虛擬子目錄下
??????????????? return UrlAuthority + Request.ApplicationPath;
??????????? }
??????? }
??????? {
??????????? string UrlAuthority = Request.Url.GetLeftPart(UriPartial.Authority);
??????????? if (Request.ApplicationPath == null || Request.ApplicationPath == "/")
??????????? {
??????????????? //直接安裝在Web站點
??????????????? return UrlAuthority;
??????????? }
??????????? else
??????????? {
??????????????? //安裝在虛擬子目錄下
??????????????? return UrlAuthority + Request.ApplicationPath;
??????????? }
??????? }
轉載于:https://www.cnblogs.com/zhongjy001/archive/2009/10/16/1584494.html
總結
- 上一篇: (转)从零实现3D图像引擎:(6)向量函
- 下一篇: jquery插件之无缝循环新闻列表