วิธีการลบ ASP
❮ อ้างอิงวัตถุโฟลเดอร์ที่สมบูรณ์
วิธีการลบจะลบไฟล์หรือโฟลเดอร์ที่ระบุ
ไวยากรณ์
FileObject.Delete[(force)]
FolderObject.Delete[(force)]
Parameter | Description |
---|---|
force | Optional. A Boolean value that indicates whether a read-only file or folder are to be deleted. True indicates that a read-only file/folder will be deleted and false indicates that it will not be deleted. Default is false. |
ตัวอย่างสำหรับวัตถุไฟล์
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\test.txt")
f.Delete
set f=nothing
set fs=nothing
%>
ตัวอย่างสำหรับวัตถุโฟลเดอร์
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test")
fo.Delete
set fo=nothing
set fs=nothing
%>
❮ อ้างอิงวัตถุโฟลเดอร์ที่สมบูรณ์