天天看点

ASP Move 方法

完整的 File 对象参考手册

Move 方法把指定文件或文件夹从一个位置移动到另外一个位置。

注意: 对 File 或 Folder 应用 Move 方法的结果与使用 FileSystemObject.MoveFile 或 FileSystemObject.MoveFolder 执行的操作完全相同。然而,要注意的是 FileSystemObject.MoveFile 或 FileSystemObject.MoveFolder 方法可移动多个文件或文件夹。

语法

FileObject.Move(destination)

FolderObject.Move(destination)

参数 描述
destination 必需的。移动文件或文件夹的目的地。不允许使用通配符。

针对 File 对象的实例

<%

dim fs,f

set fs=Server.CreateObject("Scripting.FileSystemObject")

Set f=fs.GetFile("c:\test.txt")

f.Move("c:\test\test.txt")

set f=nothing

set fs=nothing

%>

针对 Folder 对象的实例

dim fs,fo

set fo=fs.GetFolder("c:\test")

fo.Move("c:\asp\test")

set fo=nothing

完整的 File 对象参考手册