title: Downloading multiple files async VB.net
body: <p>I am creating an installer/updater for the mods on my Minecraft server. I have it set it up so that there are two files, one mod per line, and the code compares the two and downloads the latest mod if they don't match. Currently I have the downloads setup like this:</p>
  
  <pre><code>        For x = 2 To latestModCount - 1
              If currentModList(x) &lt;&gt; latestModList(x) Then
                  IO.File.Delete(applicationLocation &amp; "multimc\instances\Dan's Server\minecraft\mods\" &amp; currentModList(x))
                  My.Computer.Network.DownloadFile(OnlineFiles &amp; "mods/" &amp; latestModList(x), _
                          applicationLocation &amp; "multimc\instances\Dan's Server\minecraft\mods\" &amp; latestModList(x))
              End If
  
              'Updates currentModList to = latestModList
              objWriter.Write(latestModList(x))
          Next
  </code></pre>
  
  <p>With this method the form completely freezes while the files are downloading.</p>
  
  <p>What I want is to have a progress bar move along as each one downloads, resetting to zero each time a new one is complete. I know that using <a href="http://www.dreamincode.net/forums/topic/185093-download-file-asynchronously-with-progressbar/" rel="nofollow">this</a> method I can get one file to download and the progress bar will move along nicely. The problem with this though, is that because it uses an asynchronous download, any code below the above code is executed before the downloads have finished, which becomes a problem when trying to unzip a zip file that doesn't exist.</p>
  
  <p>If someone has a solution, please provide code examples as I this is actually my first program in any language, other than tutorial ones.</p>