取本页URL地址

protected string GetUrl()
        {
            //取本页URL地址
            //2004-3-3 wskyo
            string strTemp = "";
            if (Request.ServerVariables["HTTPS"] == "off")
            {
                strTemp = "http://";
            }
            else
            {
                strTemp = "https://";
            }

            strTemp = strTemp + Request.ServerVariables["SERVER_NAME"];

            if (Request.ServerVariables["SERVER_PORT"] != "80")
            {
                strTemp = strTemp + ":" + Request.ServerVariables["SERVER_PORT"];
            }

            strTemp = strTemp + Request.ServerVariables["URL"];

            if (Request.QueryString != null)
            {
                strTemp = strTemp + "?" + Request.QueryString;
            }

            return strTemp;
        }

posted on 2006-11-08 11:17  ccc110  阅读(199)  评论(0)    收藏  举报

导航