title: how to add proxy authentication details to webclient object
body: <p>I have some code that's throwing a 407 unauthorized exception.</p>
  
  <p>I am trying to download a file and below is my example code. I've tried with netcredentials and webproxy but in vain. </p>
  
  <pre><code>WebClient webClient = new WebClient();
  NetworkCredential netCred=new NetworkCredential();
  netCred.UserName="&lt;&lt;userid&gt;&gt;";
  netCred.Password="&lt;&lt;password&gt;&gt;";
  netCred.Domain="&lt;&lt;windowsdomainname&gt;&gt;";
  webClient.Credentials = netCred;
  WebProxy wp = new WebProxy();
  wp.Credentials = netCred;
  wp.Address = new Uri(@"http://proxy-xx.xxxx.co.uk:8080/proxy.pac");
  webClient.Proxy = wp;
  webClient.DownloadFile("http://www.win-rar.com/postdownload.html?&amp;L=0", @"c:\winrar.exe");
  </code></pre>