人人范文网 范文大全

C#登陆代码

发布时间:2020-03-03 08:56:25 来源:范文大全 收藏本文 下载本文 手机版

private void button1_Click(object sender, EventArgs e)

{

string uname = this.textBox1.Text.ToString();

string upaword = this.textBox2.Text.ToString();

SqlConnection thisconnection = new SqlConnection(@\"Server=AL;Integrated

Security=True;\" + \"DataBase=登陆界面\");

thisconnection.Open();

SqlCommand thiscommand = thisconnection.CreateCommand();

thiscommand.CommandText = \"select uname,upaword from yh where uname=\'\" + uname + \" \'\";SqlDataReader thisreader = thiscommand.ExecuteReader();

if (thisreader.Read())

{

if (thisreader[\"upaword\"].ToString().Trim() == upaword)

{

MeageBox.Show(\"恭喜您登陆成功!\", \"登陆成功!\", MeageBoxButtons.OK, MeageBoxIcon.Information);

yhxx tt = new yhxx();

tt.Show();

}

else { MeageBox.Show(\"密码错误,请重新输入!\", \"错误\", MeageBoxButtons.OK, MeageBoxIcon.Information); }

}

else { MeageBox.Show(\"此用户不存在,请您注册!\", \"注册\", MeageBoxButtons.OK, MeageBoxIcon.Information); }

thisconnection.Close();

thisreader.Close();

}

private void button2_Click(object sender, EventArgs e)

{

zhuce = new zhuce();

.Show();

}

C#代码

C# 实现winform全屏的三行关键代码

C#学习心得

C#总结

c#读书笔记

C#查找

C#心得体会

登陆阿里巴巴

C#实习心得

c#基础总结

C#登陆代码
《C#登陆代码.doc》
将本文的Word文档下载到电脑,方便编辑。
推荐度:
点击下载文档
相关专题 c 代码
点击下载本文文档