Latest web development tutorials

ASP วิธีการย้าย

อ้างอิงวัตถุโฟลเดอร์ อ้างอิงวัตถุ Complete โฟลเดอร์

ย้ายวิธีย้ายไฟล์หรือโฟลเดอร์ที่ระบุจากสถานที่หนึ่งไปยังตำแหน่งอื่น

หมายเหตุ: ไฟล์หรือโฟลเดอร์วิธีการย้ายการประยุกต์ใช้ผลการใช้ปฏิบัติการเดียวกัน FileSystemObject.MoveFolder FileSystemObject.MoveFile หรือดำเนินการแต่ก็ควรจะตั้งข้อสังเกตว่า FileSystemObject.MoveFile หรือ FileSystemObject.MoveFolder วิธีสามารถย้ายไฟล์หลายไฟล์หรือโฟลเดอร์

ไวยากรณ์

FileObject.Move(destination)

FolderObject.Move(destination)

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

สำหรับวัตถุเช่นไฟล์

<%
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,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test")
fo.Move("c:\asp\test")
set fo=nothing
set fs=nothing
%>


อ้างอิงวัตถุโฟลเดอร์ อ้างอิงวัตถุ Complete โฟลเดอร์