ChangePwd.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 System.Data.SqlClient;
namespace 工资管理系统
{
public partial class ChangePwd : Form
{
public int flag;
public string str;
public ChangePwd()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
if (button2.Text == "输入完毕请点此修改")
{
if ((str = this.textBox1.Text.ToString()) != "")
{
if (MessageBox.Show("您确定要修改密码吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
flag = 1;
MessageBox.Show("请按确定按钮,才能修改成功!");
return;
}
}
}
}
private void button1_Click(object sender, EventArgs e)
{
if (button1.Text == "确定")
{
if (flag == 1 && str != "")
{
SqlConnection con = DBCon.createCon();
con.Open();
SqlCommand cmd = new SqlCommand("update Users set UserPwd ='" + textBox3.Text.ToString() + "' where UserName='" + str + "'", con);
cmd.Connection = con;
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("修改成功!");
flag = 0;
}
}
}
private void button3_Click(object sender, EventArgs e)
{
if (button3.Text == "取消")
{
if (MessageBox.Show("确定退出密码修改吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK)
{
后面还有 6 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
