小台的IT备忘录  
脑子越来越不好用,只能依靠烂笔头了~

string strServer = "http://" + Request.ServerVariables["SERVER_NAME"].ToString();
 string strPort = ":" + Convert.ToString(Request.ServerVariables["SERVER_PORT"]);
 string strRoot = Request.ApplicationPath + "/";
 if (strPort.Trim() == ":80")
 {
      strPort = "";
 }
 string strUrl = strServer + strPort + strRoot;

posted on 2016-06-21 17:02  taiyonghai  阅读(388)  评论(0编辑  收藏  举报