Advertisement
Guest User

Untitled

a guest
Oct 4th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.09 KB | None | 0 0
  1. private void Checks()
  2.         {
  3.             string UN = Username_Text.Text;
  4.             string Pass = Password_Text.Text;
  5.  
  6.             MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
  7.  
  8.             try
  9.             {
  10.  
  11.                 cmd.Select("users").Where("Username", UN);
  12.                 MySqlReader r = new MySqlReader(cmd);
  13.  
  14.                 while (r.Read()) // Added Breakpoint and it is executing this
  15.                 {
  16.                     string RealPassword = r.ReadString("Password");
  17.                     string RealUsername = r.ReadString("Username");
  18.                     if (RealUsername == UN && RealPassword == Pass)
  19.                     {
  20.                         MessageBox.Show("YAY!");
  21.                     }
  22.                     else
  23.                     {
  24.                         MessageBox.Show("DAMN!");
  25.                     }
  26.                 }
  27.                 return; // Does not read any of the syntax above and returns instantly also no messagebox comes up :(
  28.             }
  29.             catch (Exception Exc) { MessageBox.Show(Exc.ToString()); }
  30.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement