I have a WebClient.OpenRead that is timing out on some client machines. I
believe the problem may be Proxy settings on the client machine.
How do I set proxy settings on a WebClient.OpenRead method?
Hi Steven,
Someone else may be able to help more with this, but it looks like you first
need to create a WebProxy object and use the GlobalProxySelection Class
How To Use WebClient Class To Make HTTP Requests
http://support.microsoft.com/default.aspx?scid=kb;en-us;328820#XSLTH312912112212
0121120120
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemnetwebproxyclasstopic.asp
private bool SetProxy(string ProxyName)
{
//Set the proxy
proxyObject = new WebProxy(ProxyName, true); // the true is to bypass
local address
// You can get the nondynamic proxy settings from Internet Explorer 5.5.
// by using the line below. This is what we use by default if you don't
set anything.
//WebProxy proxyObject = WebProxy.GetDefaultProxy();
// set the Credentials to the user's system credentials
// This will handle NTLM authentication.
// We will error trap for basic and then reqeust the username a password
proxyObject.Credentials = CredentialCache.DefaultCredentials;
GlobalProxySelection.Select = proxyObject;
return true;
}
>I have a WebClient.OpenRead that is timing out on some client machines. I
> believe the problem may be Proxy settings on the client machine.
>
> How do I set proxy settings on a WebClient.OpenRead method?