pwd.cs

来自「一个用C#编写的能实现即时通讯的工具」· CS 代码 · 共 52 行

CS
52
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace client
{
    public partial class pwd : Form
    {
        string Password;
        Info info;
        public pwd(string pwd, Info info)
        {
            InitializeComponent();
            this.Password = pwd;
            this.info = info;
        }

        private void pwd_Load(object sender, EventArgs e)
        {

        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            if (tbx_old.Text == Password)
            {
                if (tbx_new.Text == tbx_renew.Text)
                {
                    info.Pwd = tbx_new.Text;
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("对不起,两次输入的密码不一致!");
                }
            }
            else
            {
                MessageBox.Show("对不起,原密码不正确!");
            }
        }

        private void btn_cancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}

⌨️ 快捷键说明

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