private void login() { AccessDB adb = new AccessDB(); string sql = "select * from BASE_USERS where USER_ID = '" + TB_UserName.Text + "' and USER_PWD = '" + TB_PWD.Text + "'"; Hashtable ht = adb.login(sql); if (ht != null) { id = ht["id"].ToString(); userid = ht["userid"].ToString(); username = ht["username"].ToString(); //MessageBox.Show("登录成功!", "欢迎"); //登陆成功,返回成功信息 DialogResult = DialogResult.OK; } else { MessageBox.Show("用户名密码不匹配!", "警告"); } }