Hello everyone, I have the following code that I run inside a button clicked event in order to compare the username and password given by the user.
public static bool isAuthenticated(string Username, string Password) { //Open a connection with the databas using (WHDataDataContext db = new WHDataDataContext()) { //Compare the Username and the password and return the result return db.Users.Any(check => check.Username == Username && check.Password == Cryptographer.Encrypt(Password)); } }
and I use the code like this
private void Button_Click(object sender, RoutedEventArgs e) { //Access the DatabaseControls class and use the isAuthenticated Method if (DatabaseControls.isAuthenticated(UserBox.Text, PasswordBox.Pa ...

Go to the complete details ...