ASP FileExists 方法

定义和用法

FileExists 方法可返回指示指定的文件是否存在的布尔值。如果存在,则返回 Ture,否则返回 False

语法:
  1. FileSystemObject.FileExists(filename)
参数描述
filename必需的。需检测是否存在的文件的名称。

实例

  1. <%
  2. dim fs
  3. set fs=Server.CreateObject("Scripting.FileSystemObject")
  4. if fs.FileExists("c:\asp\introduction.asp")=true then
  5. response.write("File c:\asp\introduction.asp 存在!")
  6. else
  7. response.write("File c:\asp\introduction.asp 不存在!")
  8. end if
  9. set fs=nothing
  10. %>

分类导航