webclient and proxy

Erdenemandal

Regular
Joined
Jul 5, 2004
Messages
63
Location
Deutschland
Hi, All

I have a Problem with Proxy. I want to download file from a Server. But when I using proxy it gives me "The remote server returned an error (407) Proxy authentication Required" error message.

This is my code.

Code:
Dim wclient As New System.Net.WebClient

If mySettings.mProxy = 1 Then

   System.Net.GlobalProxySelection.Select = New    System.Net.WebProxy("http://" & mySettings.mProxyIP & ":" & mySettings.mProxyPort)
        wclient.Credentials = New System.Net.NetworkCredential(mySettings.mProxyName, mySettings.mProxyPass)                            
End If
          wclient.DownloadFile(pathUpdate & "lastVersion.ini", mySettingsPath & "lastVersion.ini")
                        Catch ex As Exception
                                MsgBox(" lasVersion : " & ex.Message)
                        End Try

Please help me. Tell me how can I download file with Proxy

Thanks,
Erdenemandal
 
Back
Top