Eine ASP-Funktion, die absolute Pfade in relative Pfade umwandelt. Freunde, die sie benötigen, können sie speichern. Kopieren Sie den Codecode wie folgt:
'=============================================
'Funktionsname: ChkMapPath
' Funktion: Relativen Pfad in absoluten Pfad umwandeln
'Parameter: strPath ---- ursprünglicher Pfad
'Rückgabewert: absoluter Pfad
'=============================================
Funktion ChkMapPath(ByVal strPath)
FullPath dimmen
strPath = Replacement(Replace(Trim(strPath), /, /), //, /)
Wenn strPath = Dann strPath = .
Wenn InStr(strPath,:/) = 0 Dann
fullPath = Server.MapPath(strPath)
Anders
strPath = Ersetzen(strPath,../,)
fullPath = Trim(strPath)
Wenn Right(fullPath, 1) = / Then
fullPath = Left(fullPath, Len(fullPath) - 1)
Ende wenn
Ende wenn
ChkMapPath = fullPath
Funktion beenden