使用(SqlConnection连接=新的SqlConnection(ConnectionString)) { SqlCommand命令=新的SqlCommand(“从用户那里选择密码,其中电子邮件='“ + UserEmail +”';“,连接); connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.HasRows)
{
while (reader.Read())
{
PasswordFromDatabase = reader.GetString(0);
}
}
reader.Close();
}
if (SimpleHash.VerifyHash(UserPassword, PasswordFromDatabase))
{
return true;
}