现在的位置: 首页 > 综合 > 正文

存储参数及MD5

2012年03月29日 ⁄ 综合 ⁄ 共 553字 ⁄ 字号 评论关闭

string pass = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPass.Text, "MD5");

 

SqlCommand cmd = new SqlCommand("select count(*) from 注册 where Name=@name and Pass=@ps", con);
                cmd.Parameters.Add(new SqlParameter("@name", SqlDbType.VarChar, 50));
                cmd.Parameters["@name"].Value = TextBox1.Text;
                cmd.Parameters.Add(new SqlParameter("@ps", SqlDbType.VarChar, 50));
                cmd.Parameters["@ps"].Value = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox2.Text, "MD5");
                int i = (int)cmd.ExecuteScalar();

 

抱歉!评论已关闭.