Пример #1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            bool passwordVerified = false;

            try
            {
                passwordVerified =
                    AuthenticationUtilities.VerifyPassword(txtUserName.Text, txtPwd.Text);
                if (passwordVerified)
                {
                    FormsAuthentication.RedirectFromLoginPage(
                        txtUserName.Text, false);
                }
                else
                {
                    //Response.Redirect("logon.aspx");
                    lblMessage.Text = string.Format(CultureInfo.InvariantCulture, Resource.InvalidUsernamePassword);
                }
            }
            catch (Exception ex)
            {
                lblMessage.Text = string.Format(CultureInfo.InvariantCulture, ex.Message);
                return;
            }
        }
Пример #2
0
 public bool LogonUser(string userName, string password, string authority)
 {
     return(AuthenticationUtilities.VerifyPassword(userName, password));
 }