Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Webclient w/ Proxy

Reply
Thread Tools

Webclient w/ Proxy

 
 
Steven J. Reed
Guest
Posts: n/a
 
      04-21-2005
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?


 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      04-21-2005
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...22120121120120


http://msdn.microsoft.com/library/de...classtopic.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;
}


"Steven J. Reed" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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?
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Proxy pattern and java.lang.reflect.Proxy/InvocationHandler Karsten Wutzke Java 1 08-20-2007 11:05 AM
Facebook Proxy | MySpace Proxy 35085675@qq.com Java 0 08-14-2007 06:35 AM
Inbound Proxy and Outbound Proxy chellappa VOIP 0 04-07-2006 10:58 AM
Press Release: Scalable SIP Proxy and RTP Media Proxy for NAT traversal sales@lanscapecorp.com VOIP 1 01-23-2006 06:32 PM
Help to set up tomcat 4.1.27 behind socks proxy to access database outside the proxy vidy5300 Java 0 06-07-2004 02:23 PM



Advertisments