asp中将相对路径转换为绝对路径的函数代码
程序员文章站
2022-07-01 23:08:43
复制代码 代码如下:'================================================ ' 函数名:chkmappath ' 作 用:相对路...
复制代码 代码如下:
'================================================
' 函数名:chkmappath
' 作 用:相对路径转换为绝对路径
' 参 数:strpath ----原路径
' 返回值:绝对路径
'================================================
function chkmappath(byval strpath)
dim fullpath
strpath = replace(replace(trim(strpath), "/", "\"), "\\", "\")
if strpath = "" then strpath = "."
if instr(strpath,":\") = 0 then
fullpath = server.mappath(strpath)
else
strpath = replace(strpath,"..\","")
fullpath = trim(strpath)
if right(fullpath, 1) = "\" then
fullpath = left(fullpath, len(fullpath) - 1)
end if
end if
chkmappath = fullpath
end function
上一篇: Java---Static内存图详解
下一篇: 力软快速开发平台建设心得