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 オブジェクトリファレンス その他の拡張