龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VB开发 >

VBS教程:对象-Files 集合

时间:2014-07-13 02:02来源:网络整理 作者:网络 点击:
分享到:
VBS教程:对象-Files 集合

Files 集合

文件夹中所有 File 对象的集合.

说明

以下代码举例说明如何获得 Folders 集合并使用 For Each...Next 语句枚举集合成员: 

Function ShowFolderList(folderspec)    Dim fso, f, f1, fc, s    Set fso = CreateObject("Scripting.FileSystemObject")    Set f = fso.GetFolder(folderspec)    Set fc = f.Files    For Each f1 in fc        s = s & f1.name         s = s & "<BR>"    Next    ShowFolderList = sEnd Function
精彩图集

赞助商链接