用于判断所指定的文件夹是否存在,也就是目录是否存在;是基于ASP中的FileSystemObject对象,也就是FSO,写成函数方便以后使用,先看检查文件夹的情况是ASP检查目录是否存在的函数:
Function CheckDir(FolderPath)
dim fso
folderpath=Server.MapPath(".")&"\"&folderpath
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(FolderPath) then
'存在
CheckDir = True
Else
'不存在
CheckDir = False
End if
Set fso = nothing
End Function
CheckDir(目录)吉公网安备 22020202000301号