Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Webclient w/ Proxy

    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?


    Steven J. Reed Guest

  2. Similar Questions and Discussions

    1. webclient.downloadfile
      I've been toying with an asp.net diretory browser and have been trying to use system.net.webclient.downloadfile as a means to download files from...
    2. DefaultCredentials and WebClient
      I'm trying to make a call inside an ASP.NET web application to an external quasi-web service (aka FrontPage Server Extensions): Dim rpcClient As...
    3. WebClient.DownloadData without cache
      I am using WebClient to download a text file from the net every 2 minutes. The problem is that I think I am reading the file from cache since when...
    4. CookieContainer with WebClient
      Any help appreciated ... I am trying to connect to a site that requires authentication through cookies, and be able to navigate through several...
    5. WebClient Problem
      hi, i using WebClient to get the website. like string URL = "http://127.0.0.1/index.htm"; WebClient client = new WebClient(); Stream data =...
  3. #2

    Default Re: Webclient w/ Proxy

    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

    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;328820#XSLTH3129121122120121120120[/url]


    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetwebproxyclasstopic.asp[/url]


    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" <StevenJReed@discussions.microsoft.com> wrote in message
    news:BA000BF3-EBD9-44DF-9372-F1A6546F3B33@microsoft.com...
    >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] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139