0xAB1E
0xAB1E

Reputation: 801

How to set VB Application Proxy Settings to Default System Proxy Settings

My application is supposed to work on a Company Network where proxy is enabled, By default when logged in all applications like browser and all can access internet normally

But when i open my application "The remote server returned an error [407] Proxy Authentication Required" error is coming

In normal internet connected PC it works well

Is there any way to set manual proxy or more preferably set the system proxy as default to the application I am too novice in the programming field

My code is

Dim PartURL As String = "http://www.google.com"
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(PartURL)
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim sourcecode As String = sr.ReadToEnd()
SearchPageSource = sourcecode

Also my proxy settings is

Address: abcserver04
Port:    8080

Ipconfig output on cmd prompt is

Ethernet adapter local area connection
Connection Specific DNS Suffix : abc.defgroup.net
IP Address : 10.4.8.xx
Subnet Mask : 255.255.255.0
Default Gateway : 10.4.8.254

Upvotes: 1

Views: 4447

Answers (2)

xverges
xverges

Reputation: 4718

You can also use app.config.

From https://stackoverflow.com/a/8180854/239408

<system.net>
  <defaultProxy useDefaultCredentials="true" />
</system.net>

Upvotes: 1

Ciar&#225;n
Ciar&#225;n

Reputation: 3057

Try this...

request.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials

Upvotes: 2

Related Questions