//管理员输入审核用户名时验证该用户是否存在,并提示 private void textBox2_KeyUp(object sender, KeyEventArgs e) { DBlink db = new DBlink(); if (db.DBconn()) { string str = "select * from login_info where username='******'"; if (db.search(str)) { label5.Text = "*删除用户!" + textBox2.Text + "?请点击删除按钮"; button2.Enabled = true; } else { label5.Text = "*用户不存在!"; button2.Enabled = false; } } }
//管理员输入审核用户名时验证该用户是否存在,并提示 private void textBox1_KeyUp(object sender, KeyEventArgs e) { DBlink db = new DBlink(); if (db.DBconn()) { string str = "select * from login_info where tag=0 and username='******'"; if (db.search(str)) { label3.Text = "*该用户未审核!"; button1.Enabled = true; } else { label3.Text = "*用户不存在!"; button1.Enabled = false; } } }