復(fù)制代碼 代碼如下:
'================================================
' 函數(shù)名:ChkMapPath
' 作 用:相對路徑轉(zhuǎn)換為絕對路徑
' 參 數(shù):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
您可能感興趣的文章:- 談?wù)凱HP中相對路徑的問題與絕對路徑的使用
- java區(qū)分絕對路徑和相對路徑的方法
- PowerShell中把相對路徑轉(zhuǎn)換為絕對路徑的2個方法
- javascript將相對路徑轉(zhuǎn)絕對路徑示例
- C#絕對路徑拼接相對路徑的實例代碼
- php絕對路徑與相對路徑之間關(guān)系的的分析
- 相對路徑轉(zhuǎn)化成絕對路徑
- 淺談網(wǎng)頁中的相對路徑和絕對路徑
- 相對路徑與絕對路徑的區(qū)別
- 相對路徑和絕對路徑的寫法總結(jié)