⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.cs

📁 data structure c 学校管理系统
💻 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 config : Form
    {
        public config(string pass)
        {
            InitializeComponent();
            oldpass = pass;
        }
        public string oldpass;
        private void button1_Click(object sender, EventArgs e)
        {
            DataMessager change = new DataMessager(Application.StartupPath);
            if (textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "")
            { //更新系统密码
                if (oldpass != textBox2.Text) 
                {
                    MessageBox.Show("原始密码不匹配!","提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
                    return;
                }
                string sqlstr = "update users set pass = '"+textBox3.Text+"'  where id = 1";               
                if (change.modify(sqlstr))
                { 
                    MessageBox.Show("更新成功!");
                    this.DialogResult = DialogResult.Yes; 
                }                
            }
        }

        private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (this.textBox4.Text.Trim() != this.textBox3.Text.Trim())
            {
                this.Text ="---密码输入不完整";
            }
            else
            {
                this.Text ="---密码验证完毕";
            }
        }

        private void textBox2_MouseClick(object sender, MouseEventArgs e)
        {
            this.textBox2.Text = "";
        }

        private void textBox3_MouseClick(object sender, MouseEventArgs e)
        {
            this.textBox3.Text = "";
        }

        private void textBox4_MouseClick(object sender, MouseEventArgs e)
        {
            this.textBox4.Text = "";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -