/// <summary> /// Checks username and password against MySQL database /// </summary> /// <param name="Username"></param> /// <param name="Password"></param> /// <returns></returns> private bool checkLogin(string Username, string Password, string intercom) { if (Username == "" || Password == "" || intercom == "") { showWarning("Du måste fylla i alla fält."); return(false); } return(MySQLWorker.getUserLogin(Username, Password)); }
public ExecuteForm(string path, MySQLWorker MySql, string query) { InitializeComponent(); this.path = path; MySQL = MySql; this.query = query; gbQueryConstructor = new GeckoWebBrowser { Dock = DockStyle.Fill }; pWitchBrowser.Controls.Add(gbQueryConstructor); gbQueryConstructor.Navigate(path); }
private void tbServerNameWitchDB_TextChanged(object sender, EventArgs e) { try { MySQLWorker worker = new MySQLWorker(tbLoginWitchBD.Text, tbPasswordWitchDB.Text, "", tbServerNameWitchDB.Text); worker.Connection(); var dbs = worker.Execute("SHOW DATABASES"); cbNames.Items.Clear(); while (dbs.Read()) { string row = ""; for (int i = 0; i < dbs.FieldCount; i++) { row += dbs.GetValue(i).ToString(); } cbNames.Items.Add(row); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }