<! -- Traverse all site folders -->
<Style>
<! --
Body {font-size: 12px ;}
-->
</Style>
<Script language = "VBScript">
<! --
Sub fsubmit ()
Form1.submit
End sub
-->
</SCRIPT>
<Form name = "form1" method = "Post" Action = "findfolder. asp">
<Select size = "1" name = "fpath" onchange = "fsubmit ()">
<Option value = "0" selected> -- select -- </option>
<Option value = "/"> entire site </option>
<Option value = "."> current directory </option>
<%
Dim FSO, objfolder, objfile, strpath
Set FSO = server. Createobject ("scripting. FileSystemObject ")
Strpath = "."
Call BL (strpath)
Function BL (strpath)
Set objfolder = FSO. getfolder (server. mappath (strpath ))
For each objsubfolder in objfolder. subfolders
Response. write "<option value = '" & strpath & "\" & objsubfolder. name & "'>" & replace (strpath ,". "," ") &" \ "& objsubfolder. name & "</option>"
Call BL (strpath & "\" & objsubfolder. Name)
Next
End Function
%>
</SELECT>
</Form>
<%
Fpath = request. Form ("fpath ")
If fpath <> "0" and fpath <> empty then
Response. write "<font color =" "# ff0000"> current folder: "& replace (fpath ,". "," ") &" </font> <br>"
Set objfolder = FSO. getfolder (server. mappath (fpath ))
For each objsubfolder in objfolder. subfolders
Response. Write "subfolders:" & objsubfolder. Name & "<br>"
Next
Response. Write "<br>"
For each objfile in objfolder. Files
Response. Write "file name:" & objfile. Name & "<br>"
Next
Set objfolder = nothing
End if
%>