/// <summary>
/// Gets the absolute root
/// </summary>
public static Uri AbsoluteWebRoot
{
get www.phpstudy.net
{
var context = HttpContext.Current;
UriBuilder uri = new UriBuilder();
uri.Host = context.Request.Url.Host;
if (!context.Request.Url.IsDefaultPort)
{
uri.Port = context.Request.Url.Port;
}
uri.Path = VirtualPathUtility.ToAbsolute(\"~/\");
Uri absoluteWebRoot = uri.Uri;
return absoluteWebRoot;
}
}
本文地址:https://www.stayed.cn/item/546
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我