WebRequest - Proxy Authentication Required

D

davidcbrown

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()
 
T

Telmo Sampaio

David,

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

Telmo Sampaio
 
D

davidcbrown

Sorry, I should have mentioned that I had tried that too with no success.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top