URL截取大全,各种URL截取,获取路径,操作url路径

网址:http://localhost:1897/News/Press/Content.aspx/123?id=1#toc

Request.ApplicationPath / Request.PhysicalPath D:/Projects/Solution/web/News/Press/Content.aspx System.IO.Path.GetDirectoryName(Request.PhysicalPath D:/Projects/Solution/web/News/Press Request.PhysicalApplicationPath D:/Projects/Solution/web/ System.IO.Path.GetFileName(Request.PhysicalPath) Content.aspx Request.CurrentExecutionFilePath /News/Press/Content.aspx Request.FilePath /News/Press/Content.aspx Request.Path /News/Press/Content.aspx/123 Request.RawUrl /News/Press/Content.aspx/123?id=1 Request.Url.AbsolutePath /News/Press/Content.aspx/123 Request.Url.AbsoluteUri http://localhost:1897/News/Press/Content.aspx/123?id=1

  1. Request.Url.Scheme  http   
  2. Request.Url.Host    localhost   
  3. Request.Url.Port    1897   
  4. Request.Url.Authority   localhost:1897   
  5. Request.Url.LocalPath   /News/Press/Content.aspx/123   
  6. Request.PathInfo    /123   
  7. Request.Url.PathAndQuery    /News/Press/Content.aspx/123?id=1   
  8. Request.Url.Query   ?id=1   
  9. Request.Url.Fragment       
  10. Request.Url.Segments    /   
  11. News/   
  12. Press/   
  13. Content.aspx/   
  14. 123  

你可能感兴趣的:(.net)