title: Downloading files in Visual Studio
body: <p>I am using the code recommended by Microsoft. </p>
  
  <pre><code>My.Computer.Network.DownloadFile("mydlurl", "C:\jb\jb.exe")
  </code></pre>
  
  <p>But that throws an unhandled exception on my friends computer, and some other people, but some can use it.</p>
  
  <p>I tried using downloadasync with a progress bar, but it freezes before it even starts.(Does nothing)</p>
  
  <p>Here is my code that runs an unhandled exception on some computers.</p>
  
  <pre><code>If My.Computer.FileSystem.FileExists("C:\jb\jb.exe") Then
  Else
      'jbinfo.Text = "Please wait as your file is being downloaded."
      My.Computer.Network.DownloadFile("http://download1580.mediafire.com/g/abcdefghijklmnop/myfile.exe", "C:\jb\jb.exe", "", "", True, 500, True) '&lt;Maybe fix. Lets try.
  End If
  </code></pre>
  
  <p>The exception message is:</p>
  
  <pre><code>See the end of this message for details on invoking 
      just-in-time (JIT) debugging instead of this dialog box.
  
      ************** Exception Text **************
      System.Net.WebException: The server committed a protocol violation. Section=ResponseStatusLine
        at     Microsoft.VisualBasic.MyServices.Internal.WebClientCopy.DownloadFile(Uri address, String destinationFileName)
     at Microsoft.VisualBasic.Devices.Network.DownloadFile(Uri address, String destinationFileName, ICredentials networkCredentials, Boolean showUI, Int32 connectionTimeout, Boolean overwrite, UICancelOption onUserCancel)
     at Microsoft.VisualBasic.Devices.Network.DownloadFile(String address, String destinationFileName, String userName, String password, Boolean showUI, Int32 connectionTimeout, Boolean overwrite, UICancelOption onUserCancel)
     at Microsoft.VisualBasic.Devices.Network.DownloadFile(String address, String destinationFileName, String userName, String password, Boolean showUI, Int32 connectionTimeout, Boolean overwrite)
     at MyApp.Main.Button1_Click_1(Object sender, EventArgs e)
     at System.Windows.Forms.Control.OnClick(EventArgs e)
     at System.Windows.Forms.Button.OnClick(EventArgs e)
     at System.Windows.Forms.Button.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  </code></pre>