📄 formdenglu.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using _10901BS;
namespace _10901BS
{
public partial class formDenglu : Form
{
public static string str1;
public formDenglu()
{
InitializeComponent();
}
SqlConnection cn = new SqlConnection();
SqlCommand cm = new SqlCommand();
int i;
private void Form1_Load(object sender, EventArgs e)
{
if (cn.State == ConnectionState.Closed)
{
cn.ConnectionString = "Data Source=.;Initial Catalog=110901DB;Integrated Security=True";
cn.Open();
}
}
private void btnDL_Click(object sender, EventArgs e)
{
cm.Connection = cn;
cm.CommandText = "select * from yhxxBiao where yhID='" + this.txtYHM.Text + "'and yhPSD='" + this.txtMM.Text + "'and useAb=0";
SqlDataReader dr = cm.ExecuteReader();
if (dr.Read())
{
dr.Close();
MessageBox.Show("恭喜您登陆成功!");
this.Hide();
}
else
{
dr.Close();
MessageBox.Show("对不起您输入的信息错误,请从新输入,谢谢!");
txtYHM.Focus();
i++;
if (i == 3)
{
if (this.txtYHM.Text == "0001")
{
MessageBox.Show("对不起您的帐号已经被冻结请与管理员联系!");
Application.Exit();//关闭所有资源
}
cm.CommandText = "update yhglBiao set useAb=1 where yhID='" +this.txtYHM.Text + "'";
cm.ExecuteNonQuery();
MessageBox.Show("对不起您的帐号已经被冻结请与管理员联系!");
i = 0;
}
txtMM.Text = "";
txtYHM.Text = "";
}
}
private void btnqx_Click(object sender, EventArgs e)
{
Application.Exit();//关闭所有资源
}
private void txtYHM_TextChanged(object sender, EventArgs e)
{
str1 = this.txtYHM.Text;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -