指定的文件存在嗎?
本例演示如何首先創建FileSystemObject對象,然後使用FileExists方法來探測某文件是否存在。
<html>
<body>
<%
Set
fs=Server.CreateObject("Scripting.FileSystemObject")
If
(fs.FileExists("c:\windows\cursors\xxx.cur"))=true Then
Response.Write("文件 c:\windows\cursors\xxx.cur
存在。")
Else
Response.Write("文件
c:\windows\cursors\xxx.cur 不存在。")
End If
set fs=nothing
%>
</body>
</html>
運行結果如下:「 文件 c:\windows\cursors\xxx.cur 不存在。」