asp实现检查目录是否存在与建立目录的函数
发布时间:2016-12-29 来源:查字典编辑
摘要:'-------------------------'--检查目录是否存在'----------------------FunctionCh...
'-------------------------
'--检查目录是否存在
'----------------------
FunctionCheckDir(byvalFolderPath)
dimfso
Setfso=Server.CreateObject("Scripting.FileSystemObject")
Iffso.FolderExists(Server.MapPath(folderpath))then
'存在
CheckDir=True
Else
'不存在
CheckDir=False
Endif
Setfso=nothing
EndFunction
'-------------------------
'--建立目录
'----------------------
FunctionMakeNewsDir(byvalfoldername)
dimfso
Setfso=Server.CreateObject("Scripting.FileSystemObject")
fso.CreateFolder(Server.MapPath(foldername))
Iffso.FolderExists(Server.MapPath(foldername))Then
MakeNewsDir=True
Else
MakeNewsDir=False
EndIf
Setfso=nothing
EndFunction