ASP FileExists-methode

definitie en gebruik

De FileExists-methode retourneert een boolean-waarde die aangeeft of het opgegeven bestand bestaat. Als het bestand bestaat, wordt True geretourneerd, anders False.

syntaxis:

FileSystemObject.FileExists(filename)
parameter beschrijving
filename verplicht. Controleer of de naam van het bestand bestaat.

voorbeeld

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