Classic ASP traversal of file folders (how to traverse ASP)
<% @ Language = VBScript %>
<% Powered by 25175.net
Function bianli (PATH)
Dim FSO 'fso object
Dim objfolder 'Folder object
Dim objsubfolders
Dim objsubfolder 'subfolders
Dim objfiles
Dim objfile 'file object
Set FSO = server. Createobject ("scripting. FileSystemObject ")
On Error resume next
Set objfolder = FSO. getfolder (PATH) 'create a folder object
Set objsubfolders = objfolder. subfolders
For each objsubfolder in objsubfolders
Nowpath = path + "\" + objsubfolder. Name
Response. Write nowpath
Set objfiles = objsubfolder. Files
For each objfile in objfiles
Response. Write "<br> ---"
Response. Write objfile. Name
Next
Response. Write "<p>"
Bianli (nowpath) 'calls Recursion
Next
Set objfolder = nothing
Set objsubfolders = nothing
Set FSO = nothing
End Function
%>
<%
Bianli ("F: \") 'calls the bianli () function. Here we traverse F: disk.
%>