必须填写至少10个字的日志
nnhy 编写于 2012-07-27 18:48:21
X
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class foo : System.Web.UI.Page
{
    protected string specUrl;

    protected void Page_Load(object sender, EventArgs e)
    {
        Uri u = Request.Url;
        specUrl = string.Format("http://test.localhost{0}{1}",
            u.IsDefaultPort ? "" : ":" + u.Port,
             Request.ApplicationPath.TrimEnd('/')
        );
    }
}