Response.Write(Request.Url.GetLeftPart(System.UriPartial.Authority));
这个能获取到uri部分即: http://www.goudiannao.com
  http://www.goudiannao.com/root/sub/abc.aspx
 
root是虚拟目录名,sub是子目录,abc.aspx是文件名
想等得到全部
Request.Url.AbsoluteUri
想得到http://localhost
Request.Url.GetLeftPart(System.UriPartial.Authority)
想得到/root
Request.ApplicationPath
想得到/root/sub/abc.aspx
Request.RawUrl
Request.Url.AbsolutePath
想得到www.goudiannao.com
Request.Url.Authority
 
                    
                 
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号