CheckFile函数之asp实现检查某一文件是否存在的代码
程序员文章站
2022-07-01 23:46:49
'================================================== '函数名: checkfile '作  ...
'==================================================
'函数名: 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
'函数名: 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