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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set the default proxy

Status
Not open for further replies.

guitardave78

Programmer
Sep 5, 2001
1,294
GB
I have a vb2005 app that checks an xml feed.
I need to know how to set the default proxy for the app to use to the default internet explorer proxy settings :)

Thanks .

}...the bane of my life!
 
Did you try with:

Code:
Imports System.Net

Dim nr As New NetworkCredential(user, pwd, domain)
Dim wp As New WebProxy(ip address, port)

Sharing the best from my side...

--Prashant--
 
Yep, but that is not what I need.
I am trying to avoid the need for the user to put in proxy details and just get it from internet explorers default settings

}...the bane of my life!
 
Try with:
Code:
Dim SysProxy As IWebProxy = WebRequest.GetSystemWebProxy

Sharing the best from my side...

--Prashant--
 
Yeah thats what I though
This is my code. I keep getting a 407 proxy authentication required which ever method i use.
Code:
Dim gmailUri As String = "[URL unfurl="true"]https://gmail.google.com/gmail/feed/atom"[/URL]
Dim nc As New NetworkCredential(username, password)
Dim http As HttpWebRequest
Dim strm As Stream
http = HttpWebRequest.Create(gmailUri)
http.Proxy = WebRequest.GetSystemWebProxy

strm = http.GetResponse.GetResponseStream

}...the bane of my life!
 
Check this resource...It's in c#, I'm not sure about it, but may help you. I'll take this on priority tomorrow if it remains unanswered.
Detecting IE proxy settings

Sharing the best from my side...

--Prashant--
 
ok this is what i have now, still 407
Code:
System.Net.HttpWebRequest.DefaultWebProxy = System.Net.WebRequest.GetSystemWebProxy
System.Net.HttpWebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials
Dim gmailUri As New Uri("[URL unfurl="true"]https://gmail.google.com/gmail/feed/atom")[/URL]
Dim nc As New NetworkCredential(username, password)
Dim http As HttpWebRequest
Dim proxy As New WebProxy
Dim strm As System.IO.Stream
http = HttpWebRequest.Create(gmailUri)
http.Credentials = nc
strm = http.GetResponse.GetResponseStream

annoyingly the same thing does work in this code
Code:
System.Net.HttpWebRequest.DefaultWebProxy = System.Net.WebRequest.GetSystemWebProxy
System.Net.HttpWebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials
Dim query As New Client.FeedQuery()
Dim service As New Client.Service()
Dim nc As New NetworkCredential("asdasd", "asdasd")
service.Credentials = nc
query.Uri = New Uri("[URL unfurl="true"]http://www.google.com/calendar/feeds/asdasd@gmail.com/public/full")[/URL]

Dim calFeed As Client.AtomFeed = service.Query(query)

}...the bane of my life!
 
It may be the link.
It requires a secure login.
Now without the proxy the code works (ie at home)
The code works for a normal link with the proxy, but not the https link.

I am guessing that maybe the ssl port is getting stopped.
But
I can access the same url through internet explorer

}...the bane of my life!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top