asp中将相对路径转换为绝对路径的函数代码
程序员文章站
2022-04-14 19:03:52
复制代码 代码如下:'================================================ ' 函数名: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
下一篇: 检测回文