asp復(fù)制文件夾代碼
更新時(shí)間:2007年01月03日 00:00:00 作者:
復(fù)制代碼 代碼如下:
<%
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'檢查目標(biāo)文件夾是否存在
fso.copyfolder sFolder,oFolder
Else '目標(biāo)文件夾如果不存在就創(chuàng)建
CreateNewFolder = Server.Mappath(FolderPath)
fso.CreateFolder(CreateNewFolder)
fso.copyfolder sFolder,oFolder
End if
CopyMyFolder="復(fù)制文件夾["&server.mappath(FolderName)&"]到["&server.mappath(FolderPath)&"]成功!"
Else
CopyMyFolder="錯(cuò)誤,原文件夾["&sFolde&"]不存在!"
End If
set fso=nothing
End Function
FolderName="2006" '原文件夾
FolderPath="2008" '目標(biāo)文件夾
response.write""&CopyMyFolder(FolderName,FolderPath)&"" '復(fù)制文件夾2006下的所有內(nèi)容到2008文件夾下并返回結(jié)果
%>
您可能感興趣的文章:
- PHP文件及文件夾操作之創(chuàng)建、刪除、移動(dòng)、復(fù)制
- PHP創(chuàng)建/刪除/復(fù)制文件夾、文件
- C#程序中創(chuàng)建、復(fù)制、移動(dòng)、刪除文件或文件夾的示例
- PHP實(shí)現(xiàn)遞歸復(fù)制整個(gè)文件夾的類實(shí)例
- C#實(shí)現(xiàn)復(fù)制文件夾中文件到另一個(gè)文件夾的方法
- C#將文件復(fù)制到指定文件夾并整理
- .NET創(chuàng)建、刪除、復(fù)制文件夾及其子文件的實(shí)例方法
- C# 對(duì)文件與文件夾的操作包括刪除、移動(dòng)與復(fù)制
- PHP操作文件類的函數(shù)代碼(文件和文件夾創(chuàng)建,復(fù)制,移動(dòng)和刪除)
- 實(shí)現(xiàn)文件和文件夾的復(fù)制的方法
相關(guān)文章
ASP中FSO對(duì)象對(duì)IIS WEB服務(wù)器數(shù)據(jù)安全的威脅及對(duì)策
ASP中FSO對(duì)象對(duì)IIS WEB服務(wù)器數(shù)據(jù)安全的威脅及對(duì)策...2006-10-10