MapPath();的使用和方法.
来源:互联网 发布:手机版软件注册码 编辑:程序博客网 时间:2024/05/10 14:24
Server.MapPath获得的路径都是服务器上的物理路径,也就是常说的绝对路径.至于绝对路径的概念大家可以去google搜索.
用法:
1.Server.MapPath("/") 应用程序根目录所在的位置
如 C:/Inetpub/wwwroot/
2.Server.MapPath("./") 表示所在页面的当前目录
注:等价于Server.MapPath("") 返回 Server.MapPath("")所在页面的物理文件路径
3.Server.MapPath("../")表示上一级目录
4.Server.MapPath("~/")表示当前应用级程序的目录,如果是根目录,就是根目录,如果是虚拟目录,就是虚拟目录所在的位置
如:C:/Inetpub/wwwroot/Example/
注:等效于Server.MapPath("~")。
另:以下几句等效
string filename=Server.MapPath("./") + @"/Web.config";
string filename=Server.MapPath("./") + "/Web.config";
string filename=Server.MapPath("") + @"/Web.config"
- MapPath();的使用和方法.
- Server.MapPath() 和 Request.MapPath()使用区别
- Server.MapPath和Request.MapPath()的用法
- Server.MapPath和Request.MapPath()的用法
- Server.MapPath的使用
- 获取.net的根目录的方法 和 Server.MapPath
- ASP.NET中Server.MapPath() 和Request.MapPath()使用
- ASP.NET中Server.MapPath() 和Request.MapPath()使用
- Server.MapPath(path)的使用
- mappath使用介绍,Server.mappath和Request.mappath 有什么区别、及使用方法
- MapPath方法
- Server.MapPath方法的应用方法
- Server.MapPath方法的应用方法
- Server.MapPath方法的应用方法
- Server.MapPath方法的应用方法
- Server.MapPath方法的应用方法
- Server.MapPath方法的应用方法
- Server.MapPath方法的应用方法
- test
- android Tabhost部件
- C#中根据字节处理字符串(含中文字符)
- 嵌入式C笔试!
- contextloaderlistener throws exception
- MapPath();的使用和方法.
- 给应用程序的UI增加皮肤
- android上拔出sd卡导致flash上媒体也消失问题解决方法
- 文件,工程的组织
- SVN安装配置说明
- 浅谈全文索引
- Freescale i.MX27 IP Camera
- 非模式对话框的特点
- 操作XML,对XML的增删改查操作。asp.net C#