<html><body style="font-size: 13px">
读取一个文件夹或子文件夹内的所有文件范例<br><br>
<%
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 objFile.Name & "<br>"
Next
Else
Response.Write "文件夹"&ff&"不存在,无法读取相关信息!"
End If
Set objFolder = Nothing
Set objFSO = Nothing '释放 FileSystemObject 对象实例内存空间
%>
</body></html>