string strUserInputtedHashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile( tbPassword.Text, "sha1"); if(strUserInputtedHashedPassword == GetUsersHashedPasswordUsingUserName(tbUserName.Text)) { // sign-in successfull } else { // sign-in failed }
protected TextBox tbPassword;
protected Literal liHashedPassword;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
public void btnHash_Click(object sender, EventArgs e)
{
if(tbPassword.Text.Length > 0)
{
string strHashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(tbPassword.Text, "sha1");
liHashedPassword.Text = "Hashed Password is: " + strHashedPassword;
}
}
No comments:
Post a Comment