winfrom的登录
string compcode = string.Empty;
string name = string.Empty;
string code = string.Empty;
string psd = string.Empty;
//string psd = string.Empty;
if (this.txtUserName.Text == string.Empty)
{
MessageBox.Show("用户名不能为空!");
this.txtUserName.Focus();
return;
}
if (this.txtPassWord.Text == string.Empty)
{
MessageBox.Show("请输入密码!");
}
else if (UserManage.Userinfo_name.Contains(this.txtUserName.Text) || UserManage.Userinfo_code.Contains(this.txtUserName.Text))
{
// string psd = string.Empty;
if (this.txtcompcode .Text ==compcode ||this.txtPassWord.Text == psd ||this.txtUserName.Text ==name||this.txtUserName .Text ==code)
{
MessageBox.Show("欢迎登录本系统!", "登录成功!", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.DialogResult = DialogResult.OK;
}
else
{
MessageBox.Show("密码错误,请重新输入!", "密码错误!", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.txtPassWord.Text = string.Empty;
this.txtPassWord.Focus();
}
}
else
{
MessageBox.Show("用户名不存在!", "登录失败!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
this.txtUserName.Text = string.Empty;
this.txtPassWord.Text = string.Empty;
this.txtUserName.Focus();
//this.DialogResult = DialogResult.OK;
}
DataTable dt = HL_UserinfoBLLGen.GetdtList(compcode ,name ,code , psd);
string compcode = string.Empty;
string name = string.Empty;
string code = string.Empty;
string psd = string.Empty;
//string psd = string.Empty;
if (this.txtUserName.Text == string.Empty)
{
MessageBox.Show("用户名不能为空!");
this.txtUserName.Focus();
return;
}
if (this.txtPassWord.Text == string.Empty)
{
MessageBox.Show("请输入密码!");
}
else if (UserManage.Userinfo_name.Contains(this.txtUserName.Text) || UserManage.Userinfo_code.Contains(this.txtUserName.Text))
{
// string psd = string.Empty;
if (this.txtcompcode .Text ==compcode ||this.txtPassWord.Text == psd ||this.txtUserName.Text ==name||this.txtUserName .Text ==code)
{
MessageBox.Show("欢迎登录本系统!", "登录成功!", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.DialogResult = DialogResult.OK;
}
else
{
MessageBox.Show("密码错误,请重新输入!", "密码错误!", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.txtPassWord.Text = string.Empty;
this.txtPassWord.Focus();
}
}
else
{
MessageBox.Show("用户名不存在!", "登录失败!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
this.txtUserName.Text = string.Empty;
this.txtPassWord.Text = string.Empty;
this.txtUserName.Focus();
//this.DialogResult = DialogResult.OK;
}
DataTable dt = HL_UserinfoBLLGen.GetdtList(compcode ,name ,code , psd);
解决方案 »
- DataGridView控件添加新行后保存到数据库后如何更新表的自动递增id
- 求助,在线等:打开多个Word文档。。。
- C#打印水晶报表提示“报表加载错误”如何解决?
- C#动态创建PictureBox控件的问题
- DataGridView中对可输入项的格式校验问题,要求当格式不正确时无法输入
- ★★★★★Show()出新窗体窗体,如何将窗体自动激活
- 求:《人月传说》的下载地址
- asp.net HTML的按钮控件
- 如何从datatable或dataview中提取某一列的非重复值??急呀!弟兄们都给看看!
- 我怎样获取listView控件的Header的Rectangle属性?
- 2011年6月3日 14:01 用正则 能 弄成 2011-6-3 14:01 么
- 如何将贴中一个.net3.5 部分代码转为.net 1.1
你这句是啥意思,得到的好像都是空吧!你可以断点调试一下!
重点看这里,看看是否有相关的登录值.
如: if(DateSet.Tables[0].Rows[0]["name"].ToString() == name )