标签:user btn string sage else event .text 用户 his
private void btnOK_Click(object sender, EventArgs e)
{
btnOK.Enabled = false;
try
{
DataTable dt = userBal.GetTable(" UserName=‘" + txtUserName.Text.ToString().Trim() + "‘ and UserPwd=‘" + txtUserPwd.Text.ToString().Trim() + "‘");
if (dt.Rows.Count > 0)
{
UserSate.userid = dt.Rows[0]["ID"].ToString();
UserSate.userpower = dt.Rows[0]["UserPower"].ToString();
frmMain frm = new frmMain();
frm.Show();
this.Hide();
}
else
{
MessageBox.Show("对不起,用户名或密码不对!");
}
}
catch
{
MessageBox.Show("对不起,用户名或密码错误!");
}
finally
{
btnOK.Enabled = true;
}
}
标签:user btn string sage else event .text 用户 his
原文地址:http://www.cnblogs.com/772933011qq/p/5996079.html