返回一個 Folders 集合,由指定文件夾中包含的所有文件夾組成,包括設(shè)置了隱藏和系統(tǒng)文件屬性的文件夾。
object.SubFolders
object 應(yīng)為 Folder 對象。
下面的代碼說明了 SubFolders 屬性的用法:
[JScript] function ShowFolderList(folderspec) { var fso, f, fc, s; fso = new ActiveXObject("Scripting.FileSystemObject"); f = fso.GetFolder(folderspec); fc = new Enumerator(f.SubFolders)
; s = ""; for (;!fc.atEnd(); fc.moveNext()) { s += fc.item(); s += "<br>"; } return(s); } [VBScript] Function ShowFolderList(folderspec) Dim fso, f, f1, s, sf Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(folderspec) Set sf =f.SubFolders
For Each f1 in sf s = s & f1.name s = s & "<BR>" Next ShowFolderList = s End Function
Attributes 屬性 | DateCreated 屬性 | DateLastAccessed 屬性 | DateLastModified 屬性 | Drive 屬性 | Files 屬性 | IsRootFolder 屬性 | Name 屬性 | ParentFolder 屬性 | Path 屬性 | ShortName 屬性 | ShortPath 屬性 | Size 屬性 | Type 屬性
應(yīng)用于:Folder 對象