By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

WebRequest - Proxy Authentication Required

P: n/a
I started using .NET 2003 and my first application is to parse an HTML form.
But I am behind an ISA firewall and get "(407) Proxy Authentication
Required" with the following code. The proxy settings in webReq.Proxy
appear to be OK, even without setting them as below. IE works, but this
does not. Any ideas? (or where to ask?) -- David

Dim webReq As WebRequest = WebRequest.Create(txtUrl.Text)
webReq.Proxy = WebProxy.GetDefaultProxy
Dim webResp As WebResponse = webReq.GetResponse
Dim sr As New StreamReader(webResp.GetResponseStream, Encoding.ASCII)
Dim html As String = sr.ReadToEnd()
sr.Close()
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
David,

You may want to set the Credentials property of your WebRequest object.

Telmo Sampaio
"davidcbrown" <dc******@removethisfrontiernet.net> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
I started using .NET 2003 and my first application is to parse an HTML form. But I am behind an ISA firewall and get "(407) Proxy Authentication
Required" with the following code. The proxy settings in webReq.Proxy
appear to be OK, even without setting them as below. IE works, but this
does not. Any ideas? (or where to ask?) -- David

Dim webReq As WebRequest = WebRequest.Create(txtUrl.Text)
webReq.Proxy = WebProxy.GetDefaultProxy
Dim webResp As WebResponse = webReq.GetResponse
Dim sr As New StreamReader(webResp.GetResponseStream, Encoding.ASCII)
Dim html As String = sr.ReadToEnd()
sr.Close()

Nov 20 '05 #2

P: n/a
Sorry, I should have mentioned that I had tried that too with no success.

David

"Telmo Sampaio" <ts******@gmail.com> wrote in message
news:Om**************@TK2MSFTNGP09.phx.gbl...
David,

You may want to set the Credentials property of your WebRequest object.

Telmo Sampaio

"davidcbrown" <dc******@removethisfrontiernet.net> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
I started using .NET 2003 and my first application is to parse an HTML

form.
But I am behind an ISA firewall and get "(407) Proxy Authentication
Required" with the following code. The proxy settings in webReq.Proxy
appear to be OK, even without setting them as below. IE works, but this
does not. Any ideas? (or where to ask?) -- David

Dim webReq As WebRequest = WebRequest.Create(txtUrl.Text)
webReq.Proxy = WebProxy.GetDefaultProxy
Dim webResp As WebResponse = webReq.GetResponse
Dim sr As New StreamReader(webResp.GetResponseStream, Encoding.ASCII)
Dim html As String = sr.ReadToEnd()
sr.Close()


Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.