Une fonction asp qui convertit les chemins absolus en chemins relatifs. Les amis qui en ont besoin peuvent les enregistrer. Copiez le code comme suit :
'=================================================
'Nom de la fonction : ChkMapPath
' Fonction : Convertir le chemin relatif en chemin absolu
'Paramètre : strPath ---- chemin d'origine
'Valeur de retour : chemin absolu
'=================================================
Fonction ChkMapPath(ByVal strPath)
Atténuer le chemin complet
strPath = Remplacer (Remplacer (Trim (strPath), /, /), //, /)
Si strPath = Alors strPath = .
Si InStr(strPath,:/) = 0 Alors
fullPath = Server.MapPath(strPath)
Autre
strPath = Remplacer(strPath,../,)
chemin complet = Trim (strPath)
Si c'est vrai (fullPath, 1) = / Alors
fullPath = Gauche (fullPath, Len (fullPath) - 1)
Fin si
Fin si
ChkMapPath = chemin complet
Fonction de fin