欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

獲取根目錄的URL例如http://localhost:51898

 更新時(shí)間:2014年02月12日 11:10:54   作者:  
這篇文章主要介紹了獲取根目錄的URL的方法,需要的朋友可以參考下
復(fù)制代碼 代碼如下:

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 站點(diǎn)
AppPath = UrlAuthority;
else
//安裝在虛擬子目錄下
AppPath = UrlAuthority + Req.ApplicationPath;
}
return AppPath;
}

相關(guān)文章

最新評(píng)論