当前位置:首页 > ASP教程 > 应用技巧

CheckFile函数之asp实现检查某一文件是否存在的代码

'==================================================
'函数名: checkfile
'作  用:检查某一文件是否存在
'参  数:filename ------ 文件地址 如:/swf/1.swf
'返回值:false  ----  true
'==================================================
    public function checkfile(filename)
         on error resume next
         dim fsoobj
         set fsoobj = server.createobject("scripting.filesystemobject")
          if not fsoobj.fileexists(server.mappath(filename)) then
              checkfile = false
              exit function
          end if
         checkfile = true:set fsoobj = nothing
    end function
【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!