title: Download Multiple file, one by one using DownloadFileAsync in C#
body: <p>How can I download multiple files, one by one. Using my code. </p>
  
  <pre><code>        //Download File
      public void DownloadFile(string url, string folderfile)
      {
          WebClient wc = new WebClient();
          try
          {
              wc.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadCompleted);
              wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadChanged);
  
              wc.DownloadFileAsync(new Uri(url), folderfile);
          }
          catch (Exception ex)
          {
              MessageBox.Show("Error: \n\n" + ex.Message);
          }
      }
  
      private void DownloadChanged(object sender, DownloadProgressChangedEventArgs e)
      {
          double bytesIn = double.Parse(e.BytesReceived.ToString());
          double totalBytes = double.Parse(e.TotalBytesToReceive.ToString());
          double percentage = bytesIn / totalBytes * 100.0;
          int percente = int.Parse(Math.Truncate(percentage).ToString());
  
          PBar.Value = percente;
  
          progress.Text = percente + " %";
          size.Text = string.Format("{0} MB / {1} MB", (e.BytesReceived / 1024d / 1024d).ToString("0.00"), (e.TotalBytesToReceive / 1024d / 1024d).ToString("0.00"));
      }
  
      private void DownloadCompleted(object sender, AsyncCompletedEventArgs e)
      {
          if (e.Error != null)
          {
              MessageBox.Show("Erro: " + e.Error.Message);
          }
          else
          {
              info.Text = "Download Success.";
          }
      }
  
      public void CheckFileDownload()
      {
          string urlGame = "http://localhost/";
          string Game = "Game.exe";
          string Support = "Support.Xml";
          string Info = "Info.xml";
          if (!File.Exists(Game))
          {
              //Download Game
              DownloadFile(urlGame + Game, Game);
              info.Text = "Downloading: " + Game;
  
              //If the game is downloading full 
              DownloadFile(urlGame + Info, Info);
              DownloadFile(urlGame + Support, Support);
              info.Text = "Updating information...";
          }
      }
  
      private void Launcher_Load(object sender, EventArgs e)
      {
          CheckFileDownload();
      }
  </code></pre>
  
  <p>Because I need to update the checkpoint file, after you download the Game.</p>
  
  <p>I looked at several topics, but without success.
  Thank everyone who helped me ... Sorry for my bad English</p>
  
  <p>Thank you to all that help me. I will be very grateful...</p>