日期:2011-12-07  浏览次数:20884 次

对文件的操作--建立移动删除文件夹
对文件夹的建立
<%
dim objfso
set objfso=server.createobject("scripting,filesystemobject")
objfso.createfolder(server.mappath("\c:\newfolder"))
response.write"新文件夹的实际路为"&server.mappath("\C:\newfolder")
set objfso=nothing
%>
对文件夹的移动
<%
dim objfso
set objfso=server.createobject("scripting,filesystemobject")
if objfso.folderExists(server.mappath("\folder1")) then
objfso.moveFolder.server.mappath("\folder1"),server.mappath("c:\folder2")
else
response.write"floder1文件夹不存在无法移动"
end if
set objfso=nothing
%>

对文件夹的删除
<
dim objfso
set objfso=server.createobject("scripting,filesystemobject")
if objfso.folderExists(server.mappath("\folder1")) then
objfso.deletefolder server.mappath("\folder1")
else
response.write"文件夹不存在,无法删除"
end if
set objfso=nothing
>