C#窗体程序,用户登录的用户名以及密码的验证
输入正确的用户名和密码,提示登录成功,密码不对提示密码不正确,帐号不对提示帐号不正确,只要能实现这些功能就行...
输入正确的用户名和密码,提示登录成功,密码不对提示密码不正确,帐号不对提示帐号不正确,只要能实现这些功能就行
展开
2个回答
展开全部
protected void Login_Click(object sender, System.EventArgs e)
{
string str_val=this.tmuvd.validateusername(this.UserName.Text.Trim(),this.PassWord.Text.Trim());
if(str_val!="1")
{
this.bp_showMsg(str_val);
}
else
{
Response.Cookies["UserId"].Value=this.UserName.Text.Trim();
Response.Cookies["UserName"].Value=this.PassWord.Text.Trim();
Response.Cookies["UserLevel"].Value=this.tmgd.Get_StrResult("select UserLevel from tbUser where UserName='"+this.UserName.Text.Trim()+"'");
Response.Cookies["WaterFactory"].Value=this.tmgd.Get_StrResult("select WaterFactory from tbUser where UserName='"+this.UserName.Text.Trim()+"'");
this.bp_putJSEnd("window.open('main.htm','new','fullscreen=no,toolbars=no,menubar=no,status=no,width=1024,Height=748,top=0,left=0,resizeable=no');opener='everyone';self.close();");
}
}
{
string str_val=this.tmuvd.validateusername(this.UserName.Text.Trim(),this.PassWord.Text.Trim());
if(str_val!="1")
{
this.bp_showMsg(str_val);
}
else
{
Response.Cookies["UserId"].Value=this.UserName.Text.Trim();
Response.Cookies["UserName"].Value=this.PassWord.Text.Trim();
Response.Cookies["UserLevel"].Value=this.tmgd.Get_StrResult("select UserLevel from tbUser where UserName='"+this.UserName.Text.Trim()+"'");
Response.Cookies["WaterFactory"].Value=this.tmgd.Get_StrResult("select WaterFactory from tbUser where UserName='"+this.UserName.Text.Trim()+"'");
this.bp_putJSEnd("window.open('main.htm','new','fullscreen=no,toolbars=no,menubar=no,status=no,width=1024,Height=748,top=0,left=0,resizeable=no');opener='everyone';self.close();");
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询