0

I have a webbrowser element in a windows forms project that is waiting for document.loaded . however, prior to the page being marked as "loaded" there is a prompt that pops up asking for information. How can i program against this scenario; This is the site so you can see the prompt in case you are wondering: This Sites Login

Just To be clear, I am looking for an event that should happen when this popup box is populated into my browser control.

kaveman
  • 4,339
  • 25
  • 44
ModS
  • 806
  • 2
  • 15
  • 28

1 Answers1

0

This looks like a standard Basic Authentication challenge by the site.

When making a web request it will probably fail with a 401 as you have not supplied any credentials.

You can do so when you call Navigate e.g. (replace username and password strings with the correct credentials)

string hdr = "Authorization: Basic " + 
    Convert.ToBase64String(Encoding.ASCII.GetBytes("username" + ":" + "password")) + 
    System.Environment.NewLine;

webBrowser1.Navigate("www.url.com", null, null, hdr);
Shaun Wilde
  • 8,228
  • 4
  • 36
  • 56