userFindPwd.cs
(开头部分) 3KB这里只显示每个文件的开头 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.Text.RegularExpressions;
namespace invite_bids
{
public partial class userFindPwd : Form
{
public userFindPwd()
{
InitializeComponent();
}
private void btnOk_Click(object sender, EventArgs e)
{
if (!Regex.IsMatch(txt_uemail.Text.Trim(), @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$", RegexOptions.IgnoreCase))
{
MessageBox.Show("邮箱格式验证错误,请仔细检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); txt_uemail.Focus(); return;
}
if (txtUname.Text.Trim() == string.Empty)
{
MessageBox.Show("用户名不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtUname.Focus(); return;
}
Tb_User tb_user=new Tb_User();
DataTable dtb = tb_user.getDateTableByName(txtUname.Text.Trim());
if (dtb.Rows.Count > 0)
{
if (dtb.Rows[0]["userEmail"].ToString() == txt_uemail.Text.Trim())
{
//先产生随机密码
Random rdm = new Random();
string newPwd = string.Empty;
for (int i = 0; i < 6; i++)
{
newPwd += rdm.Next(0, 9).ToString();
}
//发送邮件 goto:继续监测
string emlto = txt_uemail.Text.Trim();
string emlSubject = "找回密码";
string emlBody = "你的新密码为:【"+newPwd+"】 为了确保数据安全请尽快修改密码!";
System.Collections.ArrayList lst = new System.Collections.ArrayList();
Ericbai.TestEmail eml = new Ericbai.TestEmail(emlto, emlSubject, emlBody, lst);
btnOk.Enabled = false ;
if (eml.SendMail())
{
if (tb_user.updateUser(" userPwd ",Ericbai.EncryptSystem.Encrypt(newPwd),txtUname.Text.Trim()))
{
后面还有 32 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。