title: Upload directory and its sub directories and contents using VB.NET over FTP
body: <p>I want to make a VB.NET software in which we can select folders and add them in a listbox. These folders and their contents are to be uploaded to a FTP site at a certain amount of time. My question is that what's the code to upload folders and its contents to FTP site. The listbox only contains the main directory locations. There maybe multiple directories in the listbox. Button 3 is the uploadnow button which later on I will connect to the timer. Button 2 is for selecting the directories.</p>
  
  <p>So far I have achieved this:</p>
  
  <pre><code>Imports System.IO
  
  Public Class SYNC
  
      Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
          Dim dialog = New FolderBrowserDialog()
          Dim dir As String
          dialog.SelectedPath = Application.StartupPath
          If DialogResult.OK = dialog.ShowDialog() Then
              dir = dialog.SelectedPath
              ListBox1.Items.Add(Path.GetFileName(dir))
          End If
  
      End Sub
  
      Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  
      End Sub
  
  End Class
  </code></pre>