这里是一个实现将一个文件夹中的内容,包括子文件夹中的内容,复制到另一个文件夹中的asp代码。在使用的过程中要将文件夹的相对路径转换成绝对路径。转换的方法是使用server.mappath。
<%
startfile_1="d:aaa" '原始文件夹
tofile_1="c:bbb" '目标文件夹
Call copyfile(startfile_1,tofile_1)
response.write "完成"
function copyfile(startfile,tofile) 'startfile为原始文件夹路径,tofile为目标文件夹路径
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
Set MyFolder=MyFileObject.GetFolder(startfile)
domain=Split(startfile,"")(UBound(Split(startfile,"")))
For Each thing in MyFolder.Files'复制里面的文件
s=Split(thing,"")
a=UBound(s)
s3=Split(thing,"")(a)
MyFileObject.CopyFile thing,tofile&""&s3
Next
For Each thing in MyFolder.SubFolders'复制子文件夹
s=Split(thing,"")
a=UBound(s)
s3=Split(thing,"")(a)
response.write thing&"
"
response.write s1&""&domain&""&s3
response.write "
"
MyFileObject.copyFolder thing,tofile&""&s3
Next
end function
%>
原神祈愿模拟器最新版
原神祈愿模拟器手机版是一款完整汉化的趣味原神抽卡模拟小游戏,
宝宝森林美食完整版
宝宝森林美食游戏最新版是一款十分有趣的休闲益智游戏,帮助宝宝
g沙盒仇恨官方英文版(gorebox)
G沙盒仇恨英文原版是一款最近非常火热的沙盒模拟类游戏,在这里
迷你世界测试服最新版2024
迷你世界测试服2021最新版,即迷你世界的先遣服版本,用户能
闪耀暖暖最新版2024
闪耀暖暖手游这是非常好玩的换装手游,游戏内容丰富有趣,游戏环