web中对密码进行MD5加密(做笔记)

 public static string MD5(string p_String)
        {
            return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(p_String, "MD5");
        }

 

protected void Btn_MD5_Click(object sender, EventArgs e)
        {
            string m_Pwd=txtPwd.Text.Trim();
            if (!string.IsNullOrEmpty(m_Pwd))
            {
                Label1.Text = MD5(m_Pwd);
            }
        }

posted @ 2009-04-17 23:43  chinaifne  阅读(438)  评论(0编辑  收藏  举报