Phương thức Move của ASP

Định nghĩa và cách sử dụng

Phương thức Move di chuyển tệp hoặc thư mục từ một vị trí đến vị trí khác.

Cú pháp:

FileObject.Move(destination)
FolderObject.Move(destination)
Tham số Mô tả
destination Bắt buộc. Đích di chuyển tệp/thư mục. Không được sử dụng ký tự đại diện.

Mô hình

Chính là ví dụ về đối tượng File

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.GetFile("d:\test.txt")
f.Move("d:\test\test.txt")
set f=nothing
set fs=nothing
%>

Chính là ví dụ về đối tượng Folder

<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("d:\test")
fo.Move("d:\asp\test")
set fo=nothing
set fs=nothing
%>