to delete an exist file (can be .txt
.asp .php .jpg .pl ...any file)
刪除一已經確認存在的檔案
Description:
To delete a file " a.txt "
Set fso=Server.CreateObject("Scripting.FileSystemObject")
often be used
Path : identify the root on server
FileExists : to make sure the file is exist ,
or it will not working fine
Set fso=Server.CreateObject("Scripting.FileSystemObject")
常被使用在檔案與資料夾的呼叫
Path : 可幫助束記資料主機路逕
FileExists : 確認是否存在後才執行是不可缺保障檢查,免得出現錯誤訊息
<%
dim fso
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Path="c:\myWebDir\"
if fso.FileExists(Path&"a.txt") then
fso.DeleteFile(Path&"a.txt")
end if
set fso=nothing
%>