示例#1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string Password = Security.GetHash512(txtPassword.Text, txtUserID.Text);
            //string Password = Security.GetHash512(txtUserID.Text,txtUserID.Text)
            DAL_Users dAL_Users = new DAL_Users();
            // dAL_Users.saveUser(txtUserID.Text, Password);

            bool check = dAL_Users.userExistOrNot(txtUserID.Text);

            if (check)
            {
                lblMessage.Text = "User already exists";
            }
            else
            {
                dAL_Users.saveUser(txtUserID.Text, Password);
                lblMessage.Text = "Registered successfully";
            }
            lblMessage.Visible = true;
        }
示例#2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            lblsha256.Text = Security.GetHash256(txtPassword.Text, txtPassword.Text);
            // lblsha512.Text = Security.GetHash512(txtPassword.Text);
            lblsha512.Text = Security.GetHash512(txtPassword.Text, txtPassword.Text);

            string    password  = Security.GetHash256(txtPassword.Text, txtUserId.Text);
            DAL_Users dAL_Users = new DAL_Users();
            bool      check     = dAL_Users.userHasRegistered(txtUserId.Text, password);

            if (check)
            {
                lblMessage.Text = "Login Succeefully";
            }
            else
            {
                lblMessage.Text = "Invalid user name and password";
            }
            lblMessage.Visible = true;
        }