zl程序教程

您现在的位置是:首页 >  其他

当前栏目

asp中将相对路径转换为绝对路径的函数代码

转换ASP代码 函数 中将 绝对路径 相对路径
2023-06-13 09:14:28 时间
复制代码代码如下:

"================================================
"函数名:ChkMapPath
"作用:相对路径转换为绝对路径
"参数:strPath----原路径
"返回值:绝对路径
"================================================
FunctionChkMapPath(ByValstrPath)
DimfullPath
strPath=Replace(Replace(Trim(strPath),"/","\"),"\\","\")

IfstrPath=""ThenstrPath="."
IfInStr(strPath,":\")=0Then
fullPath=Server.MapPath(strPath)
Else
strPath=Replace(strPath,"..\","")
fullPath=Trim(strPath)
IfRight(fullPath,1)="\"Then
fullPath=Left(fullPath,Len(fullPath)-1)
EndIf
EndIf
ChkMapPath=fullPath
EndFunction