‘’----------------------------------------------------------------------------------
‘’
‘’ 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>,这样的话无论在多少级子目录中都不用担心路径问题了。
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/










