登录模块/ForgetPwd.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace PropertyManagementSystem
{
public partial class ForgetPwd : Form
{
public ForgetPwd()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//接收文本框所输入的值
string userName = this.textBox1.Text;
string idCard = this.textBox2.Text;
//判断是否为空
if(userName == "" || idCard == "")
{
MessageBox.Show("请输入用户名和身份证号码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
//判断用户名和身份正号码是否格式正确
if (userName.Length > 16)
{
MessageBox.Show("用户名太长,我怕你记不住,请换个短的吧!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else if (idCard.Length != 18)
{
MessageBox.Show("身份证号码必须为18位!!", "输入提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else
{
//编写sql语句
string sql = string.Format("select count(userName) from Users where userName='{0}' and idCard= '{1}'",userName,idCard);
int result = int.Parse(DBHelper.GetExecuteScalar(sql).ToString());
//判读最后结果 成功则跳转下一页面
if (result == 1)
{
ForgetPwd2 forgetpwd2 = new ForgetPwd2();
this.Hide();
this.Close();
forgetpwd2.Show();
}
else
{
//提示输入有误
MessageBox.Show("用户名或者身份证号码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
后面还有 47 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
