ASP中移动复制文件是不是通过FSO来实现的,小弟从网上转载了一段代码,但是运行起来报错,请大家帮忙看看哪里的问题。虽然ASP淘汰了,不过公司网站就是这个,要用ASP没办法啊。
1、用File对象:
Set fso=Server.CreateObject(“Scripting.FileSystemObject”)
Set f1=fso.GetFile(“d:\wwwroot\1.txt”)
f1.move(“d:\wwwroot\new1\1.txt”)
f1.copy(“d:\wwwroot\new2\1.txt”)
f1.delete
f1.close 'http://www.zhaomu.com 转载
2、用FSO对象:
Set fso=Server.CreateObject(“Scripting.FileSystemObject”)
a=fso.MoveFile(“d:\wwwroot\1.txt”,”d:\wwwroot\new1\1.txt”)
b=fso.CopyFile(“d:\wwwroot\1.txt”,”d:\wwwroot\new2\1.txt”)
c=fso.DeleteFile(“d:\wwwroot\1.txt”)