📄 checkup.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace schoolManager
{
public partial class checkup : Form
{
public checkup()
{
InitializeComponent();
}
public string pass;
private void checkup_Load(object sender, EventArgs e)
{
string xiangzhenname = "select user from users";
DataMessager data = new DataMessager(Application.StartupPath);
DataTable mytable = data.query(xiangzhenname, "users");
this.textBox1.Text = mytable.Rows[0].ItemArray[0].ToString();
this.textBox1.ReadOnly = true;
this.textBox2.Focus();
}
private void button1_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.No;
}
private void button9_Click(object sender, EventArgs e)
{
this.pass = this.textBox2.Text.Trim();
string xiangzhenname = "select pass from users";
DataMessager data = new DataMessager(Application.StartupPath);
DataTable mytable = data.query(xiangzhenname, "users");
string pass = mytable.Rows[0].ItemArray[0].ToString();
if (this.textBox2.Text.Trim().Equals(pass))
{
this.DialogResult = DialogResult.Yes;
}
else
{
if (MessageBox.Show("密码出错!", "提示", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) == DialogResult.Cancel)
{
this.DialogResult = DialogResult.No;
}
else
{
this.textBox2.Text = "";
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -