int InfoCheck(string userName, string password, string cpassword) { DataTable dt; dt = SqlClass.Fill("select * from account where userName='******'"); if (dt.Rows.Count != 0) { MessageBox.Show("账号已存在"); return(1); } if (!password.Equals(cpassword)) { MessageBox.Show("两次密码不一致"); return(2); } return(0); }
private void InfoCheck(string userName, string password) { password = Encrypt.MD5Encrypt32(password); DataTable dt = SqlClass.Fill("select * from account where userName='******'"); if (dt.Rows.Count == 0) { MessageBox.Show("账号不存在"); return; } if (!dt.Rows[0]["password"].ToString().Equals(password)) { MessageBox.Show("密码错误"); return; } id = Convert.ToInt32(dt.Rows[0]["id"]); this.Close(); }