ASP SubFolders 集合

定义和用法

SubFolders 集合可返回指定的文件夹中所有子文件夹组成的的一个集合。

语法:

  1. FolderObject.SubFolders

实例

  1. <%
  2. dim fs,fo,x
  3. set fs=Server.CreateObject("Scripting.FileSystemObject")
  4. set fo=fs.GetFolder("c:\test\")
  5.  
  6. for each x in fo.SubFolders
  7. 'Print the name of all subfolders in the test folder
  8. Response.write(x.Name & "<br />")
  9. next
  10.  
  11. set fo=nothing
  12. set fs=nothing
  13. %>

输出类似这样:

  1. css
  2. html
  3. xml
  4. asp
  5. JavaScript