如何取文件相对于网站根目录的路径?

diandianqiuqiu 2003-01-15 10:02:39
譬如我将c:\wwwroot设为站点根目录,然后有文件c:\wwwroot\test\project\1.asp,请问如何得到1.asp相对于c:\wwwroot的路径?
...全文
85 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wsj 2003-01-16
  • 打赏
  • 举报
回复
请问斑竹,这样的FAQ,是属于哪类?
好像没有ASP对象类或者基础类
(在微软的分类里,request,等基础对象属于ASP下的 Visual Basic Object Modal)
譬如我将c:\wwwroot设为站点根目录,然后有文件c:\wwwroot\test\project\1.asp,请问如何得到1.asp相对于c:\wwwroot的路径?
---------------------------------------------------------------

<% =Request.ServerVariables("URL") %>

---------------------------------------------------------------

Response.Write Replace("c:\wwwroot\test\project\1.asp",Server.MapPath("/"),"")?
diandianqiuqiu 2003-01-16
  • 打赏
  • 举报
回复
多谢两位,OK了!
孟子E章 2003-01-15
  • 打赏
  • 举报
回复
Response.Write Replace("c:\wwwroot\test\project\1.asp",Server.MapPath("/"),"")?
wsj 2003-01-15
  • 打赏
  • 举报
回复
<% =Request.ServerVariables("URL") %>

28,389

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧