zoukankan      html  css  js  c++  java
  • Request获取url信息的各种方法

    临时用到需要处理用户的URL,MSDN一下,整理了部分。现和大家Share一下:

    测试地址:http://localhost:10710/Engine/Default.aspx?aa=1&bb=c

    • Request.RawUrl---/Engine/Default.aspx?aa=1&bb=c
    • Request.Url.AbsoluteUri---http://localhost:10710/Engine/Default.aspx?aa=1&bb=c
    • Request.FilePath---/Engine/Default.aspx
    • Request.ApplicationPath---/Engine
    • Request.CurrentExecutionFilePath---/Engine/Default.aspx
    • Request.Path---/Engine/Default.aspx
    • Request.PhysicalApplicationPath---C:\Documents and Settings\Administrator\桌面\WorkkFolder\Pages\BlogEngine\Engine\
    • Request.PhysicalPath---C:\Documents and Settings\Administrator\桌面\WorkkFolder\Pages\BlogEngine\Engine\Default.aspx
     

    HttpRequest.RawUrl 获取当前请求的原始URL原始 URL 定义为 URL 中域信息之后的部分。在 URL 字符串 http://www.contoso.com/articles/recent.aspx 中,原始 URL /articles/recent.aspx。原始 URL 包括查询字符串(如果存在)。

     

    HttpRequest.FilePath: 属性 获取当前请求的虚拟路径。
    HttpRequest.ApplicationPath 属性 获取服务器上 ASP.NET 应用程序的虚拟应用程序根路径。
    HttpRequest.CurrentExecutionFilePath 属性 获取当前请求的虚拟路径。
    HttpRequest.Path 属性 获取当前请求的虚拟路径。
    HttpRequest.PhysicalApplicationPath 属性 获取当前正在执行的服务器应用程序的根目录的物理文件系统路径。
    HttpRequest.PhysicalPath 属性 获取与请求的 URL 相对应的物理文件系统路径。

     

  • 相关阅读:
    CSS清浮动
    深入理解BFC
    深入理解CSS浮动
    CSS颜色模式转换器的实现
    深入理解CSS背景
    理解CSS前景色和透明度
    深入理解CSS六种颜色模式
    HTML学习目录
    深入理解display属性
    深入理解盒模型
  • 原文地址:https://www.cnblogs.com/netwenchao/p/1666981.html
Copyright © 2011-2022 走看看