asp中將相對(duì)路徑轉(zhuǎn)換(huàn)為絕對路(lù)徑的函(hán)數
'================================================
' 函數名:ChkMapPath
' 作 用:相對路徑轉換為絕對路徑
' 參 數:strPath ----原路徑
' 返回值:絕(jué)對路徑(jìng)
'================================================
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
閱讀本文後(hòu)您(nín)有什麽感想? 已(yǐ)有(yǒu) 人(rén)給出評(píng)價!
- 1
- 1
- 1
- 1
- 1
- 1