codice:
<%
function buildTree(thePath)
if len(thePath) > 0 then
set theFolder = fso.getFolder(thePath)
set theFolders = theFolder.subfolders
set theFiles = theFolder.files
if theFolders.count > 0 or theFiles.count > 0 then
response.write "<ul>" & vbCrLf
for each theSubfolder in theFolders
response.write "[*]" & theSubfolder.name & "" & vbCrLf
call buildTree(theSubfolder)
next
for each theFile in theFiles
response.write "[*]" & theFile.name & "" & vbCrLf
next
response.write "[/list]" & vbCrLf
end if
set theFiles = nothing
set theFolders = nothing
set theFolder = nothing
end if
end function
path = "/"
path = server.mapPath(path)
set fso = server.createObject("Scripting.FileSystemObject")
call buildTree(path)
set fso = nothing
%>