request获取url的方法总结
辣么多属性、方法 不用就忘了 ,当需要用的时候挠头也想不到,现在总结一下 以备用
例如:http://localhost/testweb/default.aspx
1.Request.ApplicationPath; 获取服务器上ASP.NET应用程序的虚拟应用程序根路径
2.Request.AppRelativeCurrentExecutionFilePath; 获取应用程序根的虚拟路径,使用~使成为相对路径
3. Request.CurrentExecutionFilePath; 获取当前请求的虚拟路径
4.Request.FilePath; 获取当前请求的虚拟路径
5.Request.MapPath("virtualpath"); 将指定虚拟路径映射到物理路径
6.Request.Path; 获取当前请求的虚拟路径
7.Request.PathInfo; 获取具有url扩展名的资源的附加路径信息
8.Request.PhysicalApplicationPath; 获取当前正在执行的服务器应用程序的根目录的物理文件系统路径
9.Request.PhysicalPath; 获取与请求的url相对应的物理文件系统路径
10.Request.RawUrl;获取当前请求的原始url
11.Request.Url 获取当前请求的url
Request.Url.AbsolutePath: /testweb/default.aspx
Request.Url.AbsoluteUri: http://www.test.com/testweb/default.aspx
Request.Url.Host: www.test.com
Request.Url.LocalPath: /testweb/default.aspx
12.Request.UrlReferrer 获取客户端上次请求的url信息,该请求连接到当前url
--ServerVariables :获取web服务器变量的集合
foreach (string r in Request.ServerVariables)
{
Response.Write(r + ">>>" + Request.ServerVariables[r] + "<hr>");
}
request获取url的方法总结的更多相关文章
- Request获取url各种信息的方法
1.Request获取url各种信息的方法 测试的url地址:http://www.test.com/testweb/default.aspx, 结果如下: Request.ApplicationPa ...
- JavaScript&jQuery获取url参数方法
JavaScript&jQuery获取url参数方法 function getUrlParam(name){ var reg = new RegExp("(^|&)" ...
- jsp Request获取url信息的各种方法比较
从Request对象中可以获取各种路径信息,以下例子: 假设请求的页面是index.jsp,项目是WebDemo,则在index.jsp中获取有关request对象的各种路径信息如下 String p ...
- HttpServletRequest 获取URL的方法及区别
HttpServletRequest 获取请求的URL的方法有: 1.request.getRequestURL() 返回的是完整的url,包括Http协议,端口号,servlet名字和映射路径,但它 ...
- Request 获取Url
1.获取页面,HttpContext.Current.Request也是Request //获取当前页面url string myurl = HttpContext.Current.Request.U ...
- C# Request 获取Url
1.获取页面,HttpContext.Current.Request也是Request //获取当前页面url string myurl = System.Web.HttpContext.Curren ...
- request获取url链接和参数
//Returns the part of this request's URL from the protocol name up to the query string in th ...
- javascript中如何使用js脚本模拟"request"获取url后参数值呢?
转自:猫猫小屋--js获取url后参数信息 摘要: 下文讲述javascript中使用js代码获取url地址后面的参数值的方法分享,如下所示: 实现思路: 使用正则表达式对参数值进行匹配,获取参数后的 ...
- JavaScript获取URL参数方法总汇
现在做页面基本都用AJAX,因此导致操作很麻烦,每次都需要通过JS获取url中的参数值,网上所搜到很多资料,没一次能记住的,也不知道在哪个项目中使用过,现在又需要通过JS获取url参数,因此不能在偷懒 ...
随机推荐
- consul笔记-集群加入的问题
加入集群的问题 1 只有2个server的时候,一个挂掉,不会选举出新的leader. 2 使用 -bootstrap 可以直接启动为leader,这和-bootstrap-expect 是有区别的 ...
- centos7 docker mysql56
yum -y install docker docker pull centos docker run --name=mysqltmp -i -t centos /bin/bash yum -y in ...
- IE6/7常用的hack
hack基础: IE6: _selector{property:value;} selector{property:value;property:value !important;} //IE6 不支 ...
- 个人练习--gif图流程
1:素材图片a 图片b 2:窗口--->时间轴/动画 3:复制所选帧--->设置帧延迟 4:文件--->存储为WEB格式--->gif格式
- [讨论] win7封装时如何直接开通局域网共享
ekincheng 发表于 2016-10-31 20:17:54 https://www.itsk.com/thread-371838-1-5.html Win7封装时不能像XP那样直接开启局域网共 ...
- android log
from 点击打开链接 使用Android logcat 对我们开发.调试Android程序有很大的帮助!通过logcat,我们可以非常方便的了解到程序的执行情况,判断出错代码位置. 最简单的log ...
- HashSet其实就那么一回事儿之源码浅析
上篇文章<HashMap其实就那么一回事儿之源码浅析>介绍了hashMap, 本次将带大家看看HashSet, HashSet其实就是基于HashMap实现, 因此,熟悉了HashMap ...
- const char * char * const
2 区分 const * 与 * const 的差别 ( 1 ) 指针本身是常量不可变 ( char * ) const pCount; const (char *) pCount; ( 2 ) ...
- cmake gcc等安装备案
cmake安装,参照 http://www.cnblogs.com/voyagflyer/p/5323748.html cmake2.8以上 安装后的是/usr/local/bin/cmake -ve ...
- PHP数组去重..............过滤字段
$test_data = M('hot'); //实例化数据表 $data = $test_data->Distinct(true)->field('descriprion')->o ...