WebRequest - Proxy Authentication Required

  • Thread starter Thread starter davidcbrown
  • Start date Start date
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()
 
David,

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

Telmo Sampaio
 
Back
Top