Asp uses fso to implement file movement
functionmovefiles(sFolder,dFolder)
onerrorresumenext
dimfso
setfso=server.createobject("scripting.filesystemobject")
ifffso.folderexists(server.mappath(sFolder))andfso.folderexists(server.mappath(dFolder))then
fso.copyfolderserver.mapath(sFolder),server.mapath(dFolder)
movefiles=true
else
movefiles=false
setfso=nothing
callalertbox("The system did not find the specified path ["&sFolder&"]!",2)
endif
setfso=nothing
endfunction
aspModify folder name
functionrenamefolder(sFolder,dFolder)
onerrorresumenext
dimfso
setfso=server.createobject("scripting.filesystemobject")
ifffso.folderexists(server.mappath(sFolder))then
fso.movefoldserver.mappath(sFolder),server.mappath(dFolder)
renamefolder=true
else
renamefolder=false
setfso=nothing
callalertbox("The system did not find the specified path ["&sFolder&"]!",2)
endif
setfso=nothing
endfunction
asp Check if the folder exists
functioncheckfolder(sPATH)
onerrorresumenext
dimfso
setfso=server.createobject("scripting.filesystemobject")
ifffso.folderexists(server.mappath(sPATH))then
checkfolder=true
else
checkfolder=false
endif
setfso=nothing
endfunction
asp Check whether the file exists
functioncheckfile(sPATH)
onerrorresumenext
dimfso
setfso=server.createobject("scripting.filesystemobject")