SoFunction
Updated on 2025-04-14

ASP, FSO traversal directories and files under the directory

<%@ Language=VBScript %>
<%
'I wrote a function that traverses the directory and files in the directory.
%>
<%
function bianli(path)
set fso=("")

on error resume next
set objFolder=(path)

set objSubFolders=

for each objSubFolder in objSubFolders

nowpath=path + "\" +

nowpath

set objFiles=

for each objFile in objFiles
"<br>---"

next
"<p>"
bianli(nowpath)'recursive

next
set objFolder=nothing
set objSubFolders=nothing
set fso=nothing
end function
%>
<%
bianli("d:") 'Traveling d:disk
%>