Use Web Proxy / Network Credentials

  • Thread starter Thread starter Marty Cruise
  • Start date Start date
M

Marty Cruise

When connecting to a web service using:

Dim W As New System.Net.WebClient
W.DownloadData(MyURL)

How do you use a proxy as well as network credentials?
 
Hi,

WebClient class uses WebRequest class to access the Internet, therefore you
can use GlobalProxySelection class to set a global proxy to use. Based on
MSDN documentation, the steps are:
- Create a NetworkCredential class.
- Create a WebProxy class with your NetworkCredentials.
- Call GlobalProxySelection.Select (you don't need to create a new instance
of this) with your WebProxy class.

Hope it helps,

Huy Nguyen, Visual Basic team.

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 
Back
Top