asp中將相對路徑轉(zhuǎn)換為絕對路徑的函數(shù)代碼
更新時間:2011年05月27日 00:49:18 作者:
一個將絕對路徑轉(zhuǎn)換為相對路徑的asp函數(shù),需要的朋友可以收藏下。
復(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
相關(guān)文章
asp中去除內(nèi)容HTML標(biāo)簽的三個function函數(shù)
asp中去除內(nèi)容HTML標(biāo)簽的三個function函數(shù)...2007-03-03
ASP 獲取文件擴(kuò)展名函數(shù)getFileExt()
利用了asp的instrrev獲取最后.的位置,然后進(jìn)行截取,大家可以自己測試,其實編程過程也是大量的測試,慢慢就會發(fā)現(xiàn)更多的好東西。2009-08-08

