wort85
15-08-2011, 23:49
salve a tutti ho il seguente problema:
ho un treeview popolato con massimo 3 livelli.
questo treeview non è ninent'altro che la struttura in cartelle che voglio creare ma sto trovando delle difficoltà assurde dato che la lettura del treeview è ricorsiva.
data una path c:\
uso questo per leggere e in base al check creo quelle selezionate
Private sub Leggi()
Dim n As TreeNode
For Each n In Albero.Nodes
Stampa(n)
System.IO.Directory.CreateDirectory("C:\" & n.Text)
Next
End Sub
Private Sub Stampa(ByVal n As TreeNode)
If n.Checked = True Then
System.IO.Directory.CreateDirectory("C:\" & n.Text)
End If
Dim aNode As TreeNode
For Each aNode In n.Nodes
Stampa(aNode)
Next
End Sub
naturalmente mi crea cartelle tutte nella cartella root...
ringrazio anticipatamente per eventuali risposte
ho un treeview popolato con massimo 3 livelli.
questo treeview non è ninent'altro che la struttura in cartelle che voglio creare ma sto trovando delle difficoltà assurde dato che la lettura del treeview è ricorsiva.
data una path c:\
uso questo per leggere e in base al check creo quelle selezionate
Private sub Leggi()
Dim n As TreeNode
For Each n In Albero.Nodes
Stampa(n)
System.IO.Directory.CreateDirectory("C:\" & n.Text)
Next
End Sub
Private Sub Stampa(ByVal n As TreeNode)
If n.Checked = True Then
System.IO.Directory.CreateDirectory("C:\" & n.Text)
End If
Dim aNode As TreeNode
For Each aNode In n.Nodes
Stampa(aNode)
Next
End Sub
naturalmente mi crea cartelle tutte nella cartella root...
ringrazio anticipatamente per eventuali risposte