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();