title: The remote server returned an error: (407) Proxy Authentication Required in windows application
body: <p>While running below code i got "The remote server returned an error: (407) Proxy Authentication Required." issue. I did lots of RND but still facing same problem...</p>
  
  <p>Code:</p>
  
  <pre><code>Private Sub btnDownload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDownload.Click
      Application.DoEvents()
      Dim web_client As WebClient = New WebClient
      Try
          web_client.UseDefaultCredentials = True
  
          web_client.DownloadFile(txtRemoteFile.Text, txtLocalFile.Text)
          MessageBox.Show("Done")
  
      Catch ex As Exception
          Dim wp As WebProxy
          wp = New WebProxy("ProxyIP", ProxyPort)
          wp.Credentials = New NetworkCredential("LoginName", "Password", "DomainName")
          web_client.Proxy = wp
          web_client.DownloadFile(txtRemoteFile.Text, txtLocalFile.Text)
          MessageBox.Show("Done")
      End Try
  
  End Sub
  </code></pre>
  
  <p>Thanks in advance...</p>