Latest web development tutorials

ASP FileExists Method

FileSystemObject Object Reference Complete FileSystemObject Object Reference

FileExists method returns indicating the specified file exists Boolean value. If there is, it returns Ture, otherwise False.

grammar

FileSystemObject.FileExists(filename)

参数 描述
filename 必需的。需检测是否存在的文件的名称。


Examples

<%
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 Object Reference Complete FileSystemObject Object Reference