método ASP DeleteFile
DeleteFile método para borrar uno o más archivos especificados.
NOTA: Si intenta eliminar un archivo que no existe, se generará un error.
gramática
FileSystemObject.DeleteFile(filename[,force])
参数 | 描述 |
---|---|
filename | 必需的。需删除文件的名称(可使用通配符)。 |
force | 可选的。指示是否可删除只读文件的布尔值。True 指示可删除只读文件,False 指示不可删除只读文件。默认是 False。 |
Ejemplos
<%
dim fs
Set fs=Server.CreateObject("Scripting.FileSystemObject")
fs.CreateTextFile("c:\test.txt",True)
if fs.FileExists("c:\test.txt") then
fs.DeleteFile("c:\test.txt")
end if
set fs=nothing
%>
dim fs
Set fs=Server.CreateObject("Scripting.FileSystemObject")
fs.CreateTextFile("c:\test.txt",True)
if fs.FileExists("c:\test.txt") then
fs.DeleteFile("c:\test.txt")
end if
set fs=nothing
%>
Referencia completa de objetos FileSystemObject