Metoda Delete w ASP

Definicja i użycie

Metoda Delete usuwa określony plik lub folder.

Schemat:

FileObject.Delete[(przymusowy)]
FolderObject.Delete[(przymusowy)]
Parametry Opis
przymusowy Opcjonalne. Indukuje, czy plik lub folder jest usuwalny jako wartość logiczną. True oznacza, że plik lub folder zostanie usunięty, a false oznacza, że nie zostanie usunięty. Domyślnie jest false.

Przykład dla obiektu File

<%
zmienne dim fs,f
ustaw fs=Server.CreateObject("Scripting.FileSystemObject")
ustaw f=fs.GetFile("d:\test.txt")
f.Delete
ustaw f=nothing
ustaw fs=nothing
%>

Przykład dla obiektu Folder

<%
zmienne fs,fo
ustaw fs=Server.CreateObject("Scripting.FileSystemObject")
ustaw fo=fs.GetFolder("d:\test")
fo.Delete
ustaw fo=nothing
ustaw fs=nothing
%>