title: How do I determine (elegantly) if proxy authentication is required in C# winforms app
body: <p>My use case is this, I want to call out to a webservice and if I am behind a proxy server that requires authentication I want to just use the default credentials...</p>
  
  <pre><code>  WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultCredentials;
  </code></pre>
  
  <p>Otherwise I'll just simply make the call, It would be very nice to determine if the auth is required up front, rather than handle the exception after I attempt to make the call.</p>
  
  <p>Ideas?</p>