当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Copy 方法
The Copy method copies the specified file or folder from one location to another.
ASP Copy的作用是将指定的文件或文件夹从本地复制到异地。
| FileObject.Copy(destination[,overwrite]) FolderObject.Copy(destination[,overwrite]) |
| Parameter参数 | Description描述 |
|---|---|
| destination | Required. Where to copy the file or folder. Wildcard characters are not allowed 必要参数。指定文件或文件夹复制的目标地址。不支持使用通配符 |
| overwrite | Optional. A Boolean value indicating whether an existing file or folder can be overwritten. True indicates that the file/folder can be overwritten, false indicates that the file/folder cannot be overwritten. Default is true. 可选参数。逻辑值,用于指明现存的文件或文件夹是否可以被覆盖。True逻辑真表示文件/文件夹可以被覆盖;False逻辑假表示文件/文件夹不能被覆盖。默认为True逻辑真。 |
<%
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,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
%> |
评论 (0) All