ASP FileExists メソッド

定義と使用法

FileExists メソッドは、指定されたファイルが存在するかどうかを示す布尔値を返します。存在する場合、True、存在しない場合、False を返します。

语法:

FileSystemObject.FileExists(filename)
パラメータ 説明
filename 必要です。存在するファイルの名前を確認する必要があります。

<%
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists("c:\asp\introduction.asp")=trueなら
  response.write("ファイルc:\asp\introduction.aspが存在します!")
else
   response.write("File c:\asp\introduction.asp does not exist!")
ifエンド
fs = nothing と設定
%>