📜  ASP 子文件夹集合

📅  最后修改于: 2022-05-13 01:56:53.029000             🧑  作者: Mango

ASP 子文件夹集合

ASP SubFolders Collection用于返回指定文件夹中所有子文件夹的集合。

句法:

FolderObject.SubFolders

示例:下面的代码演示了 ASP Folder.SubFolders 集合。

ASP
<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
  
'Get the folder to be read
set fo=fs.GetFolder("d:\GFG\")
  
'Loop through the subfolders in the folder
for each x in fo.SubFolders
  'Print the name of all subfolders in the GFG folder
  Response.write("Subfolder Name: " & x.Name & "
") next    set fo=nothing set fs=nothing %>


输出:

Subfolder Name: html
Subfolder Name: css
Subfolder Name: asp
Subfolder Name: vbscript