C#登陆代码_c

其他范文 时间:2020-02-28 16:10:26 收藏本文下载本文
【www.daodoc.com - 其他范文】

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#登陆代码word格式文档
下载C#登陆代码.doc
将本文档下载到自己电脑,方便修改和收藏。
点此处下载文档

文档为doc格式

相关专题 c 代码
    热门文章
      整站推荐
        点击下载本文