Adds

Saturday, 4 May 2013

Check password using MD5 encryption method in C#


using System.Web.Security;
using System.Drawing;

Write this code Under the click event of Check Button:

string password, check;
password = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, "MD5");
check = FormsAuthentication.HashPasswordForStoringInConfigFile(txtEnterPassword.Text, "MD5");

            if (password == check)
            {
                lblPassword.Text = "Password Match";
                lblPassword.ForeColor = Color.Green;
            }
            else
            {
                lblPassword.Text = "Password Incorrect";
                lblPassword.ForeColor = Color.Red;
            }