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