unixaj 发表于 2016-08-17 11:15

asp判断文件夹是否存在的函数调用问题请教

每次调用这个判断文件夹是否存在的函数都返回true,请问这个函数有问题吗?

function tesfold(foname) '用来检测指定的目录是否存在

Set FSO=createobject("Scripting.FileSystemObject")
    if FSO.FolderExists(foname) then
      tesfold=True
   else
      tesfold= False
   end if
   set FSO=nothing
end function

调用的代码是这样的
mdname=server.mappath(UPPATH)

'response.write(mdname)
'response.write(tesfold(mdname) )
if not tesfold(mdname)thencall createfold(mdname)

mdname测试了明明是不存在的目录,response.write(tesfold(mdname) )却是true
请问是不是函数有问题?
页: [1]
查看完整版本: asp判断文件夹是否存在的函数调用问题请教