asp中將相對(duì)路徑轉(zhuǎn)換為絕對(duì)路徑的函數(shù)
'================================================
' 函數(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
關(guān)鍵詞:asp
閱讀本文后您有什么感想? 已有 人給出評(píng)價(jià)!
- 1
- 1
- 1
- 1
- 1
- 1