|
-
Oct 30th, 2007, 11:03 AM
#1
Thread Starter
Addicted Member
[RESOLVED] [2005] WebClient Proxy
How do I mask my webclient with a proxy? I need to download a page, but I need to download it with a specified proxy. Any help?
-
Oct 30th, 2007, 01:36 PM
#2
Re: [2005] WebClient Proxy
Code:
Dim MyWebClient As New Net.WebClient
Dim MyWebProxy As New Net.WebProxy
Dim MyCredentials As New Net.NetworkCredential
With MyCredentials
.UserName = "kleinma"
.Password = "secret"
End With
With MyWebProxy
.Address = New Uri("proxy addr here")
.Credentials = MyCredentials
.BypassProxyOnLocal = True 'or false
End With
MyWebClient.Proxy = MyWebProxy
-
Oct 30th, 2007, 02:22 PM
#3
Thread Starter
Addicted Member
Re: [2005] WebClient Proxy
Thakns very much, resolved
-
Feb 6th, 2012, 07:02 AM
#4
New Member
Re: [RESOLVED] [2005] WebClient Proxy
When i use this in VS 2010
then i get a warning:
Warning 1 Variable 'Mywebproxy' is used before it has been assigned a value. A null reference exception could result at runtime.
Please help me with this.
-
Feb 6th, 2012, 10:50 AM
#5
Re: [RESOLVED] [2005] WebClient Proxy
The only reason you would get a warning like that is if you forgot to put the "New" keyword in the line that declares the myWebProxy variable. If you retyped the example code and didn't copy/paste it, then that is likely your issue.
-
Feb 8th, 2012, 11:32 PM
#6
New Member
Re: [RESOLVED] [2005] WebClient Proxy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|