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

📄 frmalterpassword.cs

📁 学生宿舍管理系统 学生宿舍管理系统
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace 学生宿舍管理系统
{
    public partial class FrmAlterPassword : Form
    {
        string UserName, PassWord;
        public FrmAlterPassword( string a, string b)
        {
            UserName= a; PassWord = b;
            InitializeComponent();
        }
    private void FrmAlterPassword_Load(object sender, EventArgs e)
        {
            label1.Text = UserName;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string s = "update 登录信息表 set 密码='" + textBox2.Text + "' where 用户名='"+label1.Text+ "'";
            if (PassWord == textBox1.Text)
            {
                if (textBox2.Text == "") return;
                if (textBox2.Text != textBox3.Text)
                {
                    MessageBox.Show("两次密码输入不一致!");
                    
                }
                else
                {
                    MyData mydata = new MyData();
                    mydata.updateSql(s);
                    MessageBox.Show("密码修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.textBox1.Text = "";
                    this.textBox2.Text = "";
                    this.textBox3.Text = "";
                    this.textBox2.Focus();
                    mydata.closeConnection();
                }

            }
            else
            {
                MessageBox.Show("原密码输入错误,请重新输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                textBox1.Text = "";
                textBox2.Text = "";
                textBox3.Text = "";
                textBox1.Focus();
            }
        }

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

      
    }
}

⌨️ 快捷键说明

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