Пример #1
0
        static public string SelectUserType(string name, string pwd, string hash)
        {
            SqlDataAdapter adapterUserLog = new SqlDataAdapter("SELECT UserType FROM UserLog Where UserName = '******' AND MotDePasse = '" + Crypt_str.Encrypt_str(pwd, hash) + "'"
                                                               , Connect.ConnectionString);

            DataTable dt = new DataTable();

            adapterUserLog.Fill(dt);
            return(dt.Rows[0][0].ToString());
        }
Пример #2
0
        static public bool VerifyConnection(string name, string pwd, string hash)
        {
            SqlDataAdapter adapterUserLog = new SqlDataAdapter("SELECT COUNT(*) FROM UserLog Where UserName = '******' AND MotDePasse = '" + Crypt_str.Encrypt_str(pwd, hash) + "'"
                                                               , Connect.ConnectionString);

            DataTable dt = new DataTable();

            adapterUserLog.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }