找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1548|回复: 1

[建站技术] asp中将相对路径转换为绝对路径的函数代码

[复制链接]
发表于 2011-6-1 09:27:07 | 显示全部楼层 |阅读模式

  1. '================================================
  2. ' 函数名:ChkMapPath
  3. ' 作 用:相对路径转换为绝对路径
  4. ' 参 数:strPath ----原路径
  5. ' 返回值:绝对路径
  6. '================================================
  7. Function ChkMapPath(ByVal strPath)
  8. Dim fullPath
  9. strPath = Replace(Replace(Trim(strPath), "/", ""), "\", "")

  10. If strPath = "" Then strPath = "."
  11. If InStr(strPath,":") = 0 Then
  12. fullPath = Server.MapPath(strPath)
  13. Else
  14. strPath = Replace(strPath,"..","")
  15. fullPath = Trim(strPath)
  16. If Right(fullPath, 1) = "" Then
  17. fullPath = Left(fullPath, Len(fullPath) - 1)
  18. End If
  19. End If
  20. ChkMapPath = fullPath
  21. End Function
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|王牌互联

GMT+8, 2024-12-21 08:12 , Processed in 0.037366 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表