Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect proxy settings

Status
Not open for further replies.

robUK2

Programmer
Mar 10, 2008
57
0
0
TH
Hello,

VB 2008

I am using the code to detect if a proxy has been set under "Internet Options". If there is a proxy then I will set this in my webclient.

So I am just checking if the address of the proxy exists. If there is not, then there is no proxy to set in the webclient.

Is this the correct way to do this:

Many thanks for any advice,

Code:
Dim proxy As WebProxy = WebProxy.GetDefaultProxy()

f proxy.Address.ToString() <> String.Empty Then
	Console.WriteLine("Proxy URL: " & proxy.Address.ToString())
	wc.Proxy = proxy
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top