SHOW:
|
|
- or go back to the newest paste.
| 1 | private void Button1_Click(object sender, EventArgs e) | |
| 2 | {
| |
| 3 | string connString = "Server=****;Port=****;Database=****;Uid=trytokillme;password=****;"; | |
| 4 | MySqlConnection conn = new MySqlConnection(connString); | |
| 5 | MySqlCommand username = conn.CreateCommand(); | |
| 6 | MySqlCommand password = conn.CreateCommand(); | |
| 7 | MySqlCommand checkusername = conn.CreateCommand(); | |
| 8 | username.CommandText = "SELECT tool_username FROM phpbb_users WHERE tool_username = '" + TextBox1.Text + "'"; | |
| 9 | password.CommandText = "SELECT tool_password FROM phpbb_users WHERE tool_username = '" + TextBox1.Text + "'"; | |
| 10 | checkusername.CommandText = "SELECT COUNT(tool_username) FROM phpbb_users Where tool_username ='" + TextBox1.Text + "'"; | |
| 11 | try | |
| 12 | {
| |
| 13 | conn.Open(); | |
| 14 | Int64 check = (Int64)checkusername.ExecuteScalar(); | |
| 15 | if (TextBox1.Text == "") | |
| 16 | {
| |
| 17 | MessageBox.Show("Enter your username!");
| |
| 18 | } | |
| 19 | else if (TextBox2.Text == "") | |
| 20 | {
| |
| 21 | MessageBox.Show("Enter your password!");
| |
| 22 | } | |
| 23 | else if (check != 0) | |
| 24 | {
| |
| 25 | MessageBox.Show("Wrong username or password!");
| |
| 26 | } | |
| 27 | else | |
| 28 | {
| |
| 29 | try | |
| 30 | {
| |
| 31 | MySqlDataReader reader = password.ExecuteReader(); | |
| 32 | while (reader.Read()) | |
| 33 | {
| |
| 34 | - | if (reader["bot_password"].ToString() == TextBox2.Text) |
| 34 | + | if (reader["tool_password"].ToString() == TextBox2.Text) |
| 35 | {
| |
| 36 | MessageBox.Show("You are now logged in. Have fun!");
| |
| 37 | } | |
| 38 | else | |
| 39 | {
| |
| 40 | MessageBox.Show("Wrong username or password!");
| |
| 41 | } | |
| 42 | } | |
| 43 | } | |
| 44 | catch (Exception ex) | |
| 45 | {
| |
| 46 | MessageBox.Show(ex.Message); | |
| 47 | } | |
| 48 | } | |
| 49 | conn.Close(); | |
| 50 | } | |
| 51 | catch (Exception Fehler) | |
| 52 | {
| |
| 53 | MessageBox.Show(Fehler.Message); | |
| 54 | } | |
| 55 | } |