FileSystemObject 对象
指定的文件存在吗?
本例演示如何首先创建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 不存在。
指定的文件夹存在吗?
本例演示如何使用FolderExists方法探测某文件夹是否存在。
本示例代码如下:
伊图教程网[www.etoow.com]
http://www.etoow.com/html/2008-08/1218591613.html
<html>
ASP实例教程:FileSystemObject对象
'http://www.etoow.com/html/2008-08/1218591613.html