码迷,mamicode.com
首页 > 移动开发 > 详细

Server.MapPath()

时间:2014-11-19 17:53:23      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:ar   使用   sp   bs   as   new   应用   c   nbsp   

 ./当前目录
/网站主目录
../上层目录
~/网站虚拟目录

如果当前的网站目录为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

Server.MapPath()

标签:ar   使用   sp   bs   as   new   应用   c   nbsp   

原文地址:http://www.cnblogs.com/ZLGBloge/p/4108485.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!