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