private void validateBtn_Click(object sender, EventArgs e) { SQLFunc mySql = new SQLFunc(ServerAddress, Database); mySql.Err += MySql_Err; mySql.Connect(); SQLFunc.SubResults myData = mySql.Get1Data("Login", "Password", "Login='******'"); if (myData == null || myData._SubResults.Count == 0) { MessageBox.Show("Wrong Login"); NbMissed++; if (NbMissed == 3) { Random _check = new Random(); Result = Result = (int)Math.Round((double)_check.Next(1000), 0); this.Hide(); } } else { string pwd = (string)myData._SubResults[0]; if (!pwd.Equals(passwordBox.Text)) { MessageBox.Show("Wrong Password"); NbMissed++; if (NbMissed == 3) { Random _check = new Random(); Result = (int)Math.Round((double)_check.Next(1000), 0); this.Hide(); } } else { Result = Thread.CurrentThread.ManagedThreadId; this.Hide(); } } }
public MainWdw() { CultureInfo.DefaultThreadCurrentCulture = CultureInfo.GetCultureInfo("en-US"); InitializeComponent(); /*Thread myThread = Thread.CurrentThread; * * LoginWdw login = new LoginWdw(ServerAddress, Database); * login.ShowDialog(); * * if(login == null || login.Result != myThread.ManagedThreadId) { LoginFailed = true; }*/ mySQL = new SQLFunc(ServerAddress, Database); mySQL.Err += MySQL_Err; mySQL.Connect(); SetTables(); SetCoinParams(); UpdateProjectInScope(); }