If IsNothing(_parent) Then
Me.tv.Nodes.Clear()
Else
_parent.Nodes.Clear()
End If
Dim Z As ftp = New ftp()
Z.UserName = ""
Z.Password = ""
Z.Host = ""
'Directory nella root
Dim lDir() As String = Z.ListDirectory(thedir).Split(vbLf)
Dim dName As String
For Each k As String In lDir
If k = "" Then
Exit Sub
End If
If Not k.Contains("<DIR>") Then
Continue For
End If
dName = Mid(k, k.IndexOf("<DIR>") + 6, k.Length)
dName = Replace(LTrim(RTrim(dName)), vbCr, "")
Dim p As New System.Windows.Forms.TreeNode(dName, 0, 0)
p.Tag = thedir & "/" & dName
If IsNothing(_parent) Then
Me.tv.Nodes.Add(p)
Else
_parent.Nodes.Add(p)
End If
Non capisco il codice, potresti spiegarmelo meglio?
A cosa serve la stringa "<DIR>" che tiri fuori nel For?
Se la conoscenza crea problemi, non è con l'ignoranza che si risolvono [Isaac Asimov]