Metoda ASP FileExists
Metoda Fileexists zwroty wskazujące określony plik istnieje wartość logiczną. Jeśli istnieje, zwraca Ture, w przeciwnym wypadku False.
gramatyka
FileSystemObject.FileExists(filename)
参数 | 描述 |
---|---|
filename | 必需的。需检测是否存在的文件的名称。 |
Przykłady
<%
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
%>
Kompletna FileSystemObject Object Reference