title: Basic authentication with c# in webBrowser Forms Application
body: <p>I searched the web for this problem and found always this line as answer:</p>
  
  <pre><code>this.webBrowser1.Url = new System.Uri("https://username:password@url", System.UriKind.Absolute);
  </code></pre>
  
  <p>But this is no longer supported in IE</p>
  
  <p>Now I have implemented this:</p>
  
  <pre><code>this.webBrowser1.Url = new System.Uri("myurl", System.UriKind.Absolute);
  this.webBrowser1.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.webBrowser1_DocumentCompleted);
  </code></pre>
  
  <p>Within the function <code>webBrowser1_DocumentCompleted</code> I have the following:</p>
  
  <pre><code>private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  {
    string username = "myusername";
    string password = "mypassword";
    string auth = System.Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(username + ":" + password));
    string headers = "Authorization: Basic " + auth + "\r\n";
    webBrowser1.ScriptErrorsSuppressed = true;
    webBrowser1.Navigate("https://myurl", "", null, headers);
  } // added for completeness by editor
  </code></pre>
  
  <p>This does not load the complete page, and it refreshes every few seconds. Any suggestions?</p>
  
  <p>Thank you very much.</p>