絶対パスを相対パスに変換する ASP 関数を必要とする友人がそれを保存できます。次のようにコードをコピーします。
'===============================================
'関数名: ChkMapPath
' 機能: 相対パスを絶対パスに変換します
'パラメータ: strPath ---- 元のパス
'戻り値:絶対パス
'===============================================
関数 ChkMapPath(ByVal strPath)
ディムフルパス
strPath = Replace(Replace(Trim(strPath), /, /), //, /)
strPath = の場合、strPath = になります。
InStr(strPath,:/) = 0 の場合
fullPath = Server.MapPath(strPath)
それ以外
strPath = 置換(strPath,../,)
フルパス = トリム(strPath)
If Right(fullPath, 1) = / then
fullPath = Left(fullPath, Len(fullPath) - 1)
終了の場合
終了の場合
ChkMapPath = フルパス
終了機能