ASP Copy 方法
asp copy 方法

copy 方法可把指定的文件或文件夾從一個位置拷貝到另外一個位置。
注意:對 file 或 folder 應(yīng)用 copy 方法的結(jié)果與使用 filesystemobject.copyfile 或 filesystemobject.copyfolder 執(zhí)行的操作完全相同。在 filesystemobject.copyfile 或 filesystemobject.copyfolder 中,使用 object 引用文件或文件夾,并將文件或文件夾作為參數(shù)傳遞給 filesystemobject.copyfile 或 filesystemobject.copyfolder。然而,應(yīng)該注意的是 filesystemobject.copyfile 或 filesystemobject.copyfolder 方法可以復(fù)制多個文件或文件夾。
語法
fileobject.copy(destination[,overwrite])
folderobject.copy(destination[,overwrite])
folderobject.copy(destination[,overwrite])
參數(shù) | 描述 |
---|---|
destination | 必需的。復(fù)制文件或文件夾的目的地。不允許使用通配符。 |
overwrite | 可選的。指示是否可覆蓋已有的文件或文件夾的布爾值。true 表示文件/文件夾可被覆蓋,false 表示文件/文件夾不可被覆蓋。默認(rèn)是 true。 |
針對 file 對象的實例
<%
dim fs,f
set fs=server.createobject("scripting.filesystemobject")
set f=fs.getfile("c:\test.txt")
f.copy("c:\new_test.txt",false)
set f=nothing
set fs=nothing
%>
dim fs,f
set fs=server.createobject("scripting.filesystemobject")
set f=fs.getfile("c:\test.txt")
f.copy("c:\new_test.txt",false)
set f=nothing
set fs=nothing
%>
針對 folder 對象的實例
<%
dim fs,fo
set fs=server.createobject("scripting.filesystemobject")
set fo=fs.getfolder("c:\test")
fo.copy("c:\new_test",false)
set fo=nothing
set fs=nothing
%>
dim fs,fo
set fs=server.createobject("scripting.filesystemobject")
set fo=fs.getfolder("c:\test")
fo.copy("c:\new_test",false)
set fo=nothing
set fs=nothing
%>

相關(guān)文章
- ASP 表單
- ASP Cookies
- ASP Session 對象
- ASP 引用文件
- ASP Request 對象
- ASP Dictionary 對象
- AJAX 簡介
- AJAX 數(shù)據(jù)庫
- ASP 總結(jié)
- ASP Copy 方法
- ASP Delete 方法
- ASP Exists 方法
- ASP Charset 屬性
- ASP End 方法
- ASP Contents 集合
- ASP Contents.Remove 方法
- ASP ScriptTimeout 屬性
- ASP GetDriveName 方法
- ASP GetFile 方法
- ASP GetParentFolderName 方法