gmm.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GongZi.GongZiClass;
namespace GongZi
{
    public partial class gmm : Form
    {
        public gmm()
        {
            InitializeComponent();
        }
        DBOperate operate = new DBOperate();//创建数据库操作对象
        public string name;//声明字段
        private void button1_Click(object sender, EventArgs e)
        {
            if (txtNewPwd.Text.Trim() == "" ||
                txtNewPwd2.Text.Trim() == "" ||
                txtOldPwd.Text.Trim() == "")
            {
                MessageBox.Show("请将数据填写完整", "提示",//弹出消息对话框
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;//退出事件
            }
            else
            {
                string str =//创建SQL字符串
                    "select count(*) from tb_User where UserName='" + name + "' and UserPwd='" + this.txtOldPwd.Text.Trim() + "'";
                int i = operate.HumanNum(str);//得到记录数量
                if (i > 0)
                {
                    if (txtNewPwd.Text.Trim() != txtNewPwd2.Text.Trim())
                    {
                        MessageBox.Show("两次密码不一致", "提示",//弹出消息对话框
                            MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;//退出事件
                    }
                    else
                    {
                        string updatestr =//创建SQL字符串
                            "update tb_User set UserPwd='" + txtNewPwd2.Text.Trim() + "' where UserName='" + name + "'";
                        operate.OperateData(updatestr);//更新数据库信息
                        MessageBox.Show("密码修改成功", "提示",//弹出消息对话框
                            MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();//关闭窗体
                    }
                }
                else
                {
                    MessageBox.Show("旧密码错误", "提示",//弹出消息对话框
                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;//退出事件
                }

            }
        }
后面还有 7 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。