private void button1_Click(object sender, EventArgs e)
{
if (this.userb.Text == null || this.userb.Text == "" || this.pwdb.Text == null || this.pwdb.Text == "")
{
MessageBox.Show("请把用户名、密码信息框填完整");
}
else
{
string husers, hupws;
husers = this.userb.Text.Trim();
hupws = this.pwdb.Text.Trim();
string sql = "select count(*) from 登录账户 where Userid='" + husers + "' and Pwd='" + hupws + "'";
if (GetCount(sql) > 0)
{
Form2 j = new Form2();
j.Show();
this.Hide();
}
else
{
MessageBox.Show("用户名密码错误 请重新输入!!!");
}
}
}
public int GetCount(string sql)
{
SqlConnection cons = dss.Create();
SqlCommand cmd = new SqlCommand(sql, cons);
cons.Open();
int count = (int)cmd.ExecuteScalar();
cons.Close();
return count;
}


有哪位知道这篇文档里采用的编程语言是啥吗?(下面是效果图)
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
4条回答 默认 最新
- CSDN专家-showbo 2021-07-02 13:11关注
C# WinForm的代码,有帮助能点个采纳吗 ,谢谢~
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报