You need to handle the WebControl LoginRequest event, that is, if you want to specify the username password in the code
private void webcontrol_LoginRequest (object sender, LoginRequestEventArgs e) { e.Username = "username"; e.Password = "password"; e.Handled = EventHandling.Modal; e.Cancel = false; }
Test:
WebPreferences prefs = new WebPreferences() { ProxyConfig = "xxx.xxx.xxx.xxx:port" }; session = WebCore.CreateWebSession(prefs); webcontrol = new WebControl() { WebSession = session }; webcontrol.LoginRequest += new LoginRequestEventHandler(webcontrol_LoginRequest);
- if you do not want to handle the event, then you will get a dialog that you can enter identifiers.
source share