荆棘鸟

我颠覆整个世界只为扶正你的倒影
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

FSO查看文件夹

Posted on 2008-01-04 17:04  荆棘鸟  阅读(160)  评论(0)    收藏  举报
<%
Dim objFSO,objFolder,objFile,FF '声明 objFSO 变量存放对象实例
FF = Server.MapPath("./images")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(ff) Then
Response.write "文件夹 "&ff&" 里所有的文件:<br>"
Set objFolder = objFSO.GetFolder(ff)
For Each objFile in objFolder.Files
Response.Write "<img src="&ff&"/"&objFile.Name&">"& "<br>"
Response.Write "<a href="&objFile.Name&">"&objFile.Name & "<br>"
Next
Else
Response.Write "文件夹"&ff&"不存在,无法读取相关信息!"
End If
Set objFolder = Nothing
Set objFSO = Nothing '释放 FileSystemObject 对象实例内存空间
%>
</body></html>