Steve Miller [mailto:[EMAIL PROTECTED]] wrote:

> I am attempting to use the WebClient to access retrieve
> information from a web page.  In general the code works as
> expected until I attempt to run it in a client environment
> where the proxy server requires authentication. This causes
> the code to throw a System.Net.WebException.  The error
> message return is =93The remote server returned an error:
> (407) Proxy Authentication Required=94.  This behavior is as
> expected.  What I have not been able to determine is how to
> send the required authentication information to the proxy
> server.  Any help would be appreciated.

Have a look at the WebProxy class[1]. You need to either set the
GlobalProxySelection's[2] Select static member to an instance so that
default HttpWebRequest's will automatically inherit it or explicitly set the
WebRequest::Proxy[3] property on the instance you're working with.

HTH,
Drew

[ .NET MVP | weblog: http://radio.weblogs.com/0104813/ ]

[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemNetWebProxyClassTopic.asp
[2]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemnetglobalproxyselectionclasstopic.asp?frame=true
[3]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemNetWebRequestClassProxyTopic.asp?frame=true

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to