ASP FileExists 方法


FileSystemObject 對象參考手冊 完整的 FileSystemObject 對象參考手冊

FileExists 方法返回指示指定的檔是否存在的布爾值。如果存在,則返回 Ture,否則返回 False。

語法

FileSystemObject.FileExists(filename)

參數 描述
filename 必需的。需檢測是否存在的檔的名稱。


實例

<%
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists("c:\asp\introduction.asp") then
  response.write("File c:\asp\introduction.asp exists!")
else
  response.write("File c:\asp\introduction.asp does not exist!")
end if
set fs=nothing
%>


FileSystemObject 對象參考手冊 完整的 FileSystemObject 對象參考手冊