ASP Move 方法

Move 方法把指定檔或檔夾從一個位置移動到另外一個位置。
注意:對 File 或 Folder 應用 Move 方法的結果與使用 FileSystemObject.MoveFile 或 FileSystemObject.MoveFolder 執行的操作完全相同。然而,要注意的是 FileSystemObject.MoveFile 或 FileSystemObject.MoveFolder 方法可移動多個檔或檔夾。
語法
FileObject.Move(destination)
FolderObject.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
%>
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 fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test")
fo.Move("c:\asp\test")
set fo=nothing
set fs=nothing
%>
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test")
fo.Move("c:\asp\test")
set fo=nothing
set fs=nothing
%>
