ASP DeleteFile 메서드
❮ 완전한 FileSystemObject 개체 참조
DeleteFile 메서드는 하나 이상의 지정된 파일을 삭제합니다.
참고: 존재하지 않는 파일을 삭제하려고 하면 오류가 발생합니다.
통사론
FileSystemObject.DeleteFile(filename[,force])
Parameter | Description |
---|---|
filename | Required. The name of the file or files to delete (Wildcards are allowed) |
force | Optional. A Boolean value that indicates whether read-only files will be deleted. True indicates that the read-only files will be deleted, False indicates that they will not be deleted. Default is False |
예시
<%
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
%>
❮ 완전한 FileSystemObject 개체 참조