public static bool checkLogin1(string masv, string psw)
        {
            string psw1 = PasswordUtil.HashPassword(psw);

            using (SqlConnection objConnection = Nuce_Common.GetConnection())
            {
                if (objConnection == null)
                {
                    return(false);
                }
                try
                {
                    //Execute select command
                    string    strSql = string.Format(@"select 1 from [dbo].[dnn_Nuce_Eduweb_sv_pass] where [masv]='{0}' and [pass]='{1}' ", masv, psw1);
                    DataTable dt     = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(objConnection, CommandType.Text, strSql).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                catch
                {
                    return(false);
                }
            }
        }
Example #2
0
 private static string CreatePasswordHash(string pwd, string salt)
 {
     return(PasswordUtil.HashPassword(pwd));
 }