ASP.NET中Request.ApplicationPath、Request.FilePath、Request.Path、.Request.MapPath
1.Request.ApplicationPath->当前应用的目录
2.Request.FilePath->对应于iis的虚拟目录
如 URL http://mockte.com/1/index.html/pathinfo
FilePath = /1/index.html
3.Request.Path->当前请求的虚拟路径
Path 是 FilePath 和 PathInfo 尾部的串联。例如 URL http://mockte.com/1/index.html/pathinfo
那么Path = /1/index.html/pathinfo
4.Request.MapPath(string url)->将url映射为iis上的虚拟目录
这个目录都是相对于application的根目录的
于Server.MapPath相比,不会包含类似c:/这样的路径
可以理解为是相对路径(对比的Server.MapPath就是绝对路径)
5.Server.MapPath(string url)->将url映射为服务器上的物理路径
例如 http://mockte.com/1/index.html 假设你的应用程序在c:/iis/MySite中
那么就是 c:/iis/MySite/1/index.html
6.底下这张表就是根据Browser Request 的网址相关的属性的用法
网址: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 |
Request.Url.Scheme | http |
Request.Url.Host | localhost |
Request.Url.Port | 1897 |
Request.Url.Authority | localhost:1897 |
Request.Url.LocalPath | /News/Press/Content.aspx/123 |
Request.PathInfo | /123 |
Request.Url.PathAndQuery | /News/Press/Content.aspx/123?id=1 |
Request.Url.Query | ?id=1 |
Request.Url.Fragment | |
Request.Url.Segments | / News/ Press/ Content.aspx/ 123 |
ASP.NET中Request.ApplicationPath、Request.FilePath、Request.Path、.Request.MapPath的更多相关文章
- ASP.NET中Request.ApplicationPath、Request.FilePath、Request.Path、.Request.MapPath、Server.MapPath(转载)
1.Request.ApplicationPath->当前应用的目录 Jsp中, ApplicationPath指的是当前的application(应用程序)的目录,ASP.NET中也是这个 ...
- ASP.NET中Request.ApplicationPath、Request.FilePath、Request.Path、.Request.MapPath、
1.Request.ApplicationPath->当前应用的目录 Jsp中, ApplicationPath指的是当前的application(应用程序)的目录,ASP.NET中也是这 ...
- Asp.net中Request.Url的各个属性对应的意义介绍
Asp.net中Request.Url的各个属性对应的意义介绍 本文转载自 http://www.jb51.net/article/30254.htm 网络上关于Request.Url的说明已经很多也 ...
- ASP.NET中的Request、Response、Server对象
Request对象 Response.Write(Request.ApplicationPath) //应用根路径 Request.AppRelativeCurrentExecutionFilePat ...
- asp.net中Response对象鱼Request对象
在asp.net中Response与Request对象是两个常用的对象,虽然他们长得有点像,但是作用却是截然不同,我们来看一下他们他们都有哪些不同. 一.Response对象主要作用:像浏览器输出信息 ...
- ASP.NET MVC从客户端中检测到有潜在危险的 Request.Form 值
ASP.NET MVC4(Razor)从客户端中检测到有潜在危险的 Request.Form 值 “/”应用程序中的服务器错误. 从客户端(Content=" sdfdddd ...&quo ...
- 转载 ASP.NET中如何取得Request URL的各个部分
转载原地址 http://blog.miniasp.com/post/2008/02/10/How-Do-I-Get-Paths-and-URL-fragments-from-the-HttpRequ ...
- ASP.NET 中Request.QueryString 中的key
在ASP.net中 的Key是可能为null的,例如在如下的Url中 http://localhost:14546/Home/Index?a 有一个key=null 其value是a,以前一直以为ke ...
- asp.net中Request.ServerVariables的用法
在asp.net中可以通过HttpRequest.ServerVariables 属性来获取“ Web 服务器变量的集合” HttpRequest.ServerVariables 的用法: HttpR ...
随机推荐
- TCP 的那些事儿(下)
这篇文章是下篇,所以如果你对TCP不熟悉的话,还请你先看看上篇<TCP的那些事儿(上)> 上篇中,我们介绍了TCP的协议头.状态机.数据重传中的东西.但是TCP要解决一个很大的事,那就是要 ...
- OpenMP并行程序设计
1.fork/join并行执行模式的概念 2.OpenMP指令和库函数介绍 3.parallel 指令的用法 4.for指令的使用方法 5 sections和section指令的用法 1.fork/j ...
- umlの用例图
我的总结是在看完uml学习之后又參考了同学借的<uml和ooad高速入门>的思路,利用齿轮带动的原理进行.废话不多说了.首先分析一下类图和用例图的联系与差别. 类图 用例图 类class ...
- ubuntu sublime安装及配置
安装sublime-text-2: sudo add-apt-repository ppa:webupd8team/sublime-text-2 sudo apt-get update sudo ap ...
- pythonQQ邮件
http://www.cnblogs.com/lonelycatcher/archive/2012/02/09/2343463.html http://blog.csdn.net/imzoer/art ...
- 深入浅出hive-hive简介
1. 什么是hive •Hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供类SQL查询功能. •本质是将HQL转换为MapReduce程序 2. 为什么 ...
- eclipse不能识别虚拟机的问题
1.输入cmd进入dos界面,进入android-sdk-windows\platform-tools目录,执行下面命令启动adb start-server出现下面错误* daemon not run ...
- poj 1201 Interval (查分约束)
/* 数组开大保平安. 查分约束: 输入的时候维护st和end 设每个点取元素di个 维护元素个数前缀和s Sbi-Sai-1>=ci 即:建立一条从ai-1到bi的边 权值为ci 表示ai到b ...
- FineUI属性的简单总结
.PageManager控件— 页面级别的控制(包括主题.语言 等等) 覆盖web.config中自定义结点的配置 EnablePageLoading:是否启用页面的第一次加载提示,默认居中显示加载图 ...
- session在登录中的使用
package action.exam; import java.util.Map; import com.opensymphony.xwork2.ActionContext; import com. ...