Advertisement
Guest User

Untitled

a guest
Feb 18th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.33 KB | None | 0 0
  1.             if (txtUsername.Text.Length < 5 || txtPassword.Text.Length < 5)
  2.             {
  3.                 MessageBox.Show("Username or Password is incorrect!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
  4.             }
  5.          
  6.             else
  7.             {
  8.                     StreamReader sr = new StreamReader(@"Desktop\GymFucker\data\users\data.ls");
  9.                     string user = sr.ReadLine();
  10.                     string passhash = sr.ReadLine();
  11.                     sr.Close();
  12.                     string thispass = SHA1.Hashing(SHA1.Hashing(txtPassword.Text + salt));
  13.  
  14.                     if ( user.Equals(txtUsername.Text) &&  passhash.Equals(thispass))
  15.                     {
  16.                         Save_Data();
  17.                         btnLogin.Enabled = false;
  18.                         btnRegister.Enabled = false;
  19.                         txtUsername.Enabled = false;
  20.                         txtPassword.Enabled = false;
  21.  
  22.                         timer1.Start();
  23.  
  24.                     }
  25.                     else
  26.                     {
  27.                         MessageBox.Show("Username or Password is incorrect!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);                  
  28.                 }
  29.                 ////////////////////////////////////////////////////////////////////////
  30.                
  31.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement