当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Copy 方法

ASP
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO
ASP AdRotator
ASP BrowserCap
ASP Content Linking
ASP Content Rotator
ASP Quick Ref
ASP 摘要
ASP 实例

ASP Copy 方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 334 ::
收藏到网摘: n/a

The Copy method copies the specified file or folder from one location to another.
ASP Copy的作用是将指定的文件或文件夹从本地复制到异地。

Syntax
语法

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逻辑真。

Example for the File object
文件对象举例

<%
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
%>

Example for the Folder object
文件夹对象举例

<%
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

登陆 | 还没注册?