title: Download Directory in C#
body: <p>I want to can download a folder/directory from a cloud, right now i can download just files.</p>
  
  <p>How i can download and Directories?</p>
  
  <p>Code:</p>
  
  <pre><code>        void Update()
      {
          string url = "url/file.txt";
  
          if(!string.IsNullOrEmpty(url))
          {
              Thread threat = new Thread(() =&gt;
              {
                  Uri uri = new Uri(url);
                  string filename = Path.GetFileName(uri.AbsolutePath);
                  client.DownloadFileAsync(uri, File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Astro And Aliens Launcher\GameFilesPath.txt") + "/" + filename);
              });
              threat.Start();
          }
      }
  
      private void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
      {
          MessageBox.Show("Update Complete!", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
      }
  
      private void Client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
      {
          Dispatcher.Invoke(new System.Windows.Forms.MethodInvoker(delegate ()
          {
              UpdateProgress.Minimum = 0;
              double receive = double.Parse(e.BytesReceived.ToString());
              double total = double.Parse(e.TotalBytesToReceive.ToString());
              double percentage = receive / total * 100;
              updatePercentText.Content = $"Downloaded {string.Format("{0:0.##}", percentage)}%";
              UpdateProgress.Value = int.Parse(Math.Truncate(percentage).ToString());
          }));
      }
  </code></pre>