Discuz教程网

asp中将相对路径转换为绝对路径的函数代码

[复制链接]
authicon dly 发表于 2011-9-7 12:36:51 | 显示全部楼层 |阅读模式

  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
复制代码




上一篇:asp统计信息实现代码/文章每日、每周、每月、总访问量的方法
下一篇:PHP性能优化贴士——产生高度优化代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 08:46

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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