zoukankan      html  css  js  c++  java
  • .net 获取url的方法

    测试的url地址是http://www.gkxsn.com/testweb/default.aspx?id=1, 结果如下:
    Request.ApplicationPath: /testweb
    Request.CurrentExecutionFilePath: /testweb/default.aspx
    Request.FilePath: /testweb/default.aspx
    Request.Path: /testweb/default.aspx
    Request.PathInfo:
    Request.PhysicalApplicationPath: E:\WWW\testweb\
    Request.PhysicalPath: E:\WWW\testweb\default.aspx
    Request.RawUrl: /testweb/default.aspx?id=1
    Request.Url.AbsolutePath: /testweb/default.aspx
    Request.Url.AbsoluteUri: http://www.gkxsn.com/testweb/default.aspx?id=1
    Request.Url.Host: www.gkxsn.com
    Request.Url.LocalPath: /testweb/default.aspx
    Response.Write("<b>Request.ApplicationPath:</b> " + Request.ApplicationPath + "<br>");
    Response.Write("<b>Request.CurrentExecutionFilePath:</b> " + Request.CurrentExecutionFilePath + "<br>");
    Response.Write("<b>Request.FilePath:</b> " + Request.FilePath + "<br>");
    Response.Write("<b>Request.Path:</b> " + Request.Path + "<br>");
    Response.Write("<b>Request.PathInfo:</b> " + Request.PathInfo + "<br>");
    Response.Write("<b>Request.PhysicalApplicationPath:</b> " + Request.PhysicalApplicationPath + "<br>");
    Response.Write("<b>Request.PhysicalPath:</b> " + Request.PhysicalPath + "<br>");
    Response.Write("<b>Request.RawUrl:</b> " + Request.RawUrl + "<br>");
    Response.Write("<b>Request.Url.AbsolutePath:</b> " + Request.Url.AbsolutePath + "<br>");
    Response.Write("<b>Request.Url.AbsoluteUri:</b> " + Request.Url.AbsoluteUri + "<br>");
    Response.Write("<b>Request.Url.Host:</b> " + Request.Url.Host + "<br>");
    Response.Write("<b>Request.Url.LocalPath:</b> " + Request.Url.LocalPath + "<br>");

  • 相关阅读:
    Linux:less 命令
    Linux:more命令
    图解linux安装tomcat(附常用命令)
    Linux下安装tomcat
    Linux数字权限解释
    Tomcat配置远程调试
    CentOS 设置静态IP 方法
    oracle procedure存储过程
    【转】vector中erase()的使用注意事项
    strstr()函数的使用
  • 原文地址:https://www.cnblogs.com/_zjl/p/1988615.html
Copyright © 2011-2022 走看看