三条语句搞定路径
来源:岁月联盟
时间:2003-04-15
'----------------------------------------------------------------------------------
'
' function name : GetPaht()
'
' description: 解决不同目录中的路径问题
'
' parameters: none
'
' date: 2000/3/25
'
' author: LiuYunpeng
'
' History: 2000/3/25 version 1.0
'
'---------------------------------------------------------------------------------
function GetPath()
dim m_intLoop , m_strBaseDIr
for m_intLoop = 2 to ubound(split(Request.ServerVariables ("SCRIPT_NAME"),"/" )) - 1
m_strBaseDir = m_strBaseDir + "../"
next
GetPath = m_strBaseDir
end function
这是就可以这样写图片路径
<img src="&GetPath()+'Images'&"/xxx.gif>,这样的话无论在多少级子目录中都不用担心路径问题了。
上一篇:函数小数转分数,限于整除分数
下一篇:ASP+全新接触(1)