Ciao a Tutti,
nella mia pagina asp ho creato un array che ospita le cartelle e i files presenti in una certa cartella virtuale;
mi sono accorto pero' che SOLO in corrispondenza dell' ultima "subfolder" i files presenti in essa vengono memorizzati nell' array 2 o 3 volte (a seconda del contenuto in files dell' ultima "subfolder").
Come mai ??![]()
Grazie mille in anticipo !!
<%@ Language=VBScript %>
<%
Option Explicit
Dim arr_dir(3000), arr_vf(15000), fso, path, theFolder, theSubfolders, subfolder, theFiles, file, x, y
'
'
function buildTree(theFSO, thePath)
set theFolder = theFSO.getFolder(thePath)
set theSubfolders = theFolder.subfolders
for each subfolder in theSubfolders
x = x + 1
arr_dir(x) = subfolder.name
response.write x & "dir: " & subfolder.name & "
"
call buildTree(theFSO, subfolder)
next
set theSubfolders = nothing
set theFiles = theFolder.files
for each file in theFiles
y = y + 1
arr_vf(y) = file.name
response.write y & "file: " & file.name & "
"
next
end function
'
'
%>
....
<BODY>
<%
'
path = server.mapPath("/path_virtual_dir/")
set fso = server.createObject("Scripting.FileSystemObject")
call buildTree(fso, path)
'
set fso = nothing : set theFolder = nothing : set theFiles = nothing
'
%>
</BODY>