Phương thức di chuyển ASP


❮ Toàn bộ tham chiếu đối tượng thư mục

Phương thức Move di chuyển tệp hoặc thư mục được chỉ định từ vị trí này sang vị trí khác.

Cú pháp

FileObject.Move(destination)

FolderObject.Move(destination)

Parameter Description
destination Required. Where to move the file or folder. Wildcard characters are not allowed

Ví dụ cho đối tượng Tệp

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

Ví dụ cho đối tượng Thư mục

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

❮ Toàn bộ tham chiếu đối tượng thư mục