復制代碼 代碼如下:
'================================================
' 函數名: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
您可能感興趣的文章:- 談談PHP中相對路徑的問題與絕對路徑的使用
- java區分絕對路徑和相對路徑的方法
- PowerShell中把相對路徑轉換為絕對路徑的2個方法
- javascript將相對路徑轉絕對路徑示例
- C#絕對路徑拼接相對路徑的實例代碼
- php絕對路徑與相對路徑之間關系的的分析
- 相對路徑轉化成絕對路徑
- 淺談網頁中的相對路徑和絕對路徑
- 相對路徑與絕對路徑的區別
- 相對路徑和絕對路徑的寫法總結