I'm using vb.net code to open an SFTP session and list only directories, not files within directories. I have not yet been successful in creating a listing of only directories. I included the vb.net code below which should be putting only the names of directories in a listview container although I can't seem to get it to work. Any help is appreciated.
Dim directory
Dim fileInfo
directory = mySession.ListDirectory(ManageHosts.tbx_DestDirectory.Text)
Lbx_DestDirectory.Items.Clear()
With Lbx_DestDirectory
For Each fileInfo In directory.Files
If fileInfo.Name <> "." Or fileInfo.Name = "*." Then
.Items.Add(fileInfo.Name)
End If
Next
End With