Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2005

Tip: Looking for answers? Try searching our database.

Webclient w/ Proxy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steven J. Reed - 21 Apr 2005 01:29 GMT
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?
Ken Cox [Microsoft MVP] - 21 Apr 2005 14:48 GMT
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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.