Visualizzazione dei risultati da 1 a 3 su 3

Discussione: un FSO per menu

  1. #1
    Utente di HTML.it L'avatar di giuma2
    Registrato dal
    Mar 2004
    Messaggi
    49

    un FSO per menu

    ciao a tutti

    ho cercato e guardato tanti fso ma il codice che cerco deve far vedere

    tutte le subfolder di un ramo
    prima di passare alla seconda folder di 1 livello
    come fa il S.O.

    cioe'
    folder1
    file e subfolder1-1
    file e subsubfolder1
    file e subfolder1-2
    ........

    folder2
    file e subfolder1
    file se subfolder2
    etc

    potete aiutarmi?
    grazie

  2. #2
    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
    %>

  3. #3
    Utente di HTML.it L'avatar di giuma2
    Registrato dal
    Mar 2004
    Messaggi
    49
    bello, compatto e pulito,

    grazie mille
    ora lo provo
    ci attacco un js e dovrei risolvere
    ciao

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.