C#登陆代码_c

2020-02-28 其他范文 下载本文

C#登陆代码由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“c”。

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#登陆代码.docx》
将本文的Word文档下载,方便收藏和打印
推荐度:
C#登陆代码
点击下载文档
相关专题 c 代码 c 代码
[其他范文]相关推荐
    [其他范文]热门文章
      下载全文