Download files from folders?

Sep 9, 2015 at 1:16 PM

I have found this ftpclient and it works great - for uploading specific files.

However I cant figure out how to loop trough all the folders in the ftp server, and listing the files names in each folder.

Can anybody help?

Much appriciated. Thanks:)
Jan 9, 2016 at 2:51 PM
this class should do it:

Imports System.IO
Imports System.Net.FtpClient
Imports System.Net
Public Class driveSync
Friend WithEvents ftp As FtpClient
Friend local As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
Private queue As List(Of Object)

Public Sub New(ByVal drive As String, ByVal ftpP As String)
    Me.ftp = New FtpClient
    Me.queue = New List(Of Object)
    ftp.Host = "host"
    ftp.Credentials = New NetworkCredential(drive, ftpP)
End Sub

Private Sub SyncFolders(ByVal item)
    For Each explore As FtpListItem In item
        If explore.Type = FtpFileSystemObjectType.Directory Then
            SyncFolders(ftp.GetListing("/" & explore.FullName))
            If File.Exists(local & explore.FullName) Then


            End If
        End If


End Sub

Public Sub dispose()
End Sub
End Class