Welcome

首页 / 编程脚本 / VBS教程:对象-Files 集合

Files 集合

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

说明

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

Function ShowFolderList(folderspec)Dim fso, f, f1, fc, sSet fso = CreateObject("Scripting.FileSystemObject")Set f = fso.GetFolder(folderspec)Set fc = f.FilesFor Each f1 in fcs = s & f1.name s = s & "<BR>"NextShowFolderList = sEnd Function