private void Connect_Secure(string current_url) { try { using (LoginForm login = new LoginForm()) { DialogResult res = login.ShowDialog(); authentication_needed = true; if (res == System.Windows.Forms.DialogResult.OK) { loggedIn = false; webBrowser1.Navigate(String.Format(@"http://{0}:{1}@{2}", login.getUsername(), login.getPassword(), current_url.Substring(7))); } else { loading.Visible = false; exceptionRaised = true; } } } catch { if (isAutoUpdate) FindNewIP(); else DisplayPage(url); return; } }
private void LoginGhostMode() { if (loginDisplayed) return; if (!isGhostMode) { this.Show(); return; } bool loop; loginDisplayed = true; using (LoginForm login = new LoginForm(true)) { do { loop = true; login.WindowState = FormWindowState.Normal; login.Activate(); DialogResult res = login.ShowDialog(); if (res == System.Windows.Forms.DialogResult.OK) { if (login.getGhostModePassword() == password) { notify.Visible = true; loginDisplayed = false; this.Show(); loop = false; } } else loop = false; login.setPasswordClear(); } while (loop); } loginDisplayed = false; }