无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
<%
Function CopyMyFolder(FolderName,FolderPath)
sFolder=server.mappath(FolderName)
oFolder=server.mappath(FolderPath)
set fso=server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(FolderName)) Then'检查原文件夹是否存在
   if fso.folderexists(server.mappath(FolderPath)) Then'检查目标文件夹是否存在
   fso.copyfolder sFolder,oFolder
    Else '目标文件夹如果不存在就创建
            CreateNewFolder = Server.Mappath(FolderPath)
            fso.CreateFolder(CreateNewFolder)
            fso.copyfolder sFolder,oFolder
   End if
 CopyMyFolder="复制文件夹["&server.mappath(FolderName)&"]到["&server.mappath(FolderPath)&"]成功!"
Else
CopyMyFolder="错误,原文件夹["&sFolde&"]不存在!"
End If
set fso=nothing
End Function
FolderName="2006" '原文件夹
FolderPath="2008" '目标文件夹
response.write""&CopyMyFolder(FolderName,FolderPath)&"" '复制文件夹2006下的所有内容到2008文件夹下并返回结果
%>
标签:
asp复制文件夹代码

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com