复制代码 代码如下:

/// <summary>
/// Gets the absolute root
/// </summary>
public static Uri AbsoluteWebRoot
{
    get  www.atool.online
    {
        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;
    }
}

点赞(0)

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部