对文件夹操作2

发表于:2007-06-30来源:作者:点击数: 标签:
对文件的操作--建立移动删除文件夹 对文件夹的建立 % dim objfso set objfso=server.createobject(scripting,filesystemobject) objfso.createfolder(server.mappath(c:ewfolder)) response.write新文件夹的实际路为server.mappath(C:ewfolder) set objfso=no
对文件的操作--建立移动删除文件夹
对文件夹的建立
<%
dim objfso
set objfso=server.createobject("scripting,filesystemobject")
objfso.createfolder(server.mappath("c: ewfolder"))
response.write"新文件夹的实际路为"&server.mappath("C: ewfolder")
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
>

原文转自:http://www.ltesting.net