title: How can i get IE credentials to use in my code?
body: <p>I'm currently developing an IE plugin using <a href="http://code.msdn.microsoft.com/SpicIE" rel="nofollow noreferrer">SpicIE</a>. </p>
  
  <p>This plugin does some web scraping similar to the example posted on MSDN:</p>
  
  <pre><code>WebRequest request = WebRequest.Create ("http://www.contoso.com/default.html");
  
  request.Credentials = CredentialCache.DefaultCredentials;
  
  HttpWebResponse response = (HttpWebResponse)request.GetResponse ();
  
  Stream dataStream = response.GetResponseStream ();
  
  StreamReader reader = new StreamReader (dataStream);
  
  string responseFromServer = reader.ReadToEnd ();
  
  reader.Close ();
  dataStream.Close ();
  response.Close ();
  </code></pre>
  
  <p>However, when i run this code i receive the following error message:</p>
  
  <blockquote>
    <p>The remote server returned an error: (407) Proxy Authentication Required.</p>
  </blockquote>
  
  <p>I'm currently working behind a proxy server and used the <strong>NetworkCredential</strong> class to manually provide my network credentials </p>
  
  <pre><code>request.Credentials = new System.Net.NetworkCredential("name", "password", "domain");
  </code></pre>
  
  <p>but i still receive the same error.</p>
  
  <p>Even if my problem is solved, i know that some users of the plugin will be behind a proxy server.</p>
  
  <p><strong>I want to know how i can get IE credentials and use it in my code to assign it to request.Credentials</strong>. </p>
  
  <p>Maybe something like this:</p>
  
  <pre><code>request.Credentials = IE.DefaultCredentials;
  </code></pre>