Server.MapPath的用法
2011-08-14 15:36
253 查看
Server.MapPath()
./当前目录
/网站主目录
../上层目录
~/网站虚拟目录
如果当前的网站目录为E:\wwwroot 应用程序虚拟目录为E:\wwwroot\company 浏览的页面路径为E:\wwwroot\company\news\show.asp
在show.asp页面中使用
Server.MapPath("./") 返回路径为:E:\wwwroot\company\news
Server.MapPath("/") 返回路径为:E:\wwwroot
Server.MapPath("../") 返回路径为:E:\wwwroot\company
Server.MapPath("~/") 返回路径为:E:\wwwroot\company
server.MapPath(request.ServerVariables("Path_Info"))
Request.ServerVariables("Path_Translated")
上面两种方式返回路径为 D:\wwwroot\company\news\show.asp
./当前目录
/网站主目录
../上层目录
~/网站虚拟目录
如果当前的网站目录为E:\wwwroot 应用程序虚拟目录为E:\wwwroot\company 浏览的页面路径为E:\wwwroot\company\news\show.asp
在show.asp页面中使用
Server.MapPath("./") 返回路径为:E:\wwwroot\company\news
Server.MapPath("/") 返回路径为:E:\wwwroot
Server.MapPath("../") 返回路径为:E:\wwwroot\company
Server.MapPath("~/") 返回路径为:E:\wwwroot\company
server.MapPath(request.ServerVariables("Path_Info"))
Request.ServerVariables("Path_Translated")
上面两种方式返回路径为 D:\wwwroot\company\news\show.asp
相关文章推荐
- 关于asp中Server.MapPath()的用法
- Server.MapPath()用法
- 关于Server.MapPath的具体用法
- server.mapPath()的几种用法.
- Server.MapPath用法
- Server.MapPath的用法
- Server.MapPath()中参数的用法
- Server.MapPath的用法
- Server.MapPath的用法
- server.mappath用法
- ASP.NET中Server.MapPath的几种用法
- Server.MapPath和Request.MapPath()的用法
- Server.MapPath 的用法
- 总结的Server.Mappath的用法
- Server.MapPath的用法
- Server.MapPath的用法
- asp于Server.MapPath用法
- ASP.NET中Server.MapPath的几种用法
- Server.MapPath() 用法
- Server.MapPath的用法