Money-去哪了每日站立会议

继昨天的编码,今天经过调试和努力,最终调试了出来,但是还是有很多不足的地方需要明天和后期继续修改和完善,今天的成果是我们的软件登录之后的更改密码部分,因为用户不想用原来的密码之后,也可能原来密码丢失,可能原来的账号被别人盗用之后需要更改密码,这里涉及到密码的重置,确定新代码环节,如果密码格式不对,会有提示,需要重新更改。内容还不太完善。等待后期继续修改。

public partial class Form改密 : Form
{
public Form改密()
{
InitializeComponent();
}
bool flag = false;
private void button重置_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox1.Focus();
}

private void button确定_Click(object sender, EventArgs e)
{
if (textBox3.Text != Test.passward)
{
MessageBox.Show("原密码错误,请重新设置!!!");
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox3.Focus();
}
else
{
string psdback = Test.passward;
if (textBox1.Text == textBox2.Text)
{

Test.passward = textBox1.Text;
if (Test.Fun())
{
MessageBox.Show("密码更改成功,进入登录环节!!!");
Form登录 f = new Form登录();
f.Show();
flag = true;
this.Close();
}
else
{
MessageBox.Show("密码更改失败,请重试!!!");
Test.passward = psdback;
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox3.Focus();
}
}
else
{
MessageBox.Show("密码更改失败,请重试!!!");
Test.passward = psdback;
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox3.Focus();
}
}
}

private void Form改密_FormClosed(object sender, FormClosedEventArgs e)
{
if (flag)
{
return;
}
else
{
Test._f.Close();
}

}

原文地址:https://www.cnblogs.com/amnavov/p/9986590.html