WmptWap/ForgotPassword.aspx.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WMPT.SQLServerDAL;
using WMPT.Model;
namespace Html5
{
public partial class ForgotPassword : System.Web.UI.Page
{
ECustomer dal = new ECustomer();
protected void Page_Load(object sender, EventArgs e)
{
if (Request.HttpMethod.ToLower() == "post")
{
string name = WebUtility.InputText(Request.Form["tbUserName"]);
string User_Emial = WebUtility.InputText(Request.Form["tbEmail"]);
this.tbUserName.Value = name;
this.tbEmail.Value = User_Emial;
//1.验证是否注册
string sql = "[Name] = '" + name + "'";
int count = new ECustomer().GetCount(sql);
if (count <= 0)
{
divError.InnerHtml = "该用户名尚未注册!";
return;
}
//2.发送至邮箱
sql = "email = '" + User_Emial + "' and [name] = '" + name + "'";
IList<ECustomerInfo> list = dal.GetList(1, 1, sql, "dataid", 1);
if (list.Count == 1)
{
string codebuildtime = DateTime.Now.AddDays(2).ToString();
string ActivateCode = WebUtility.RandStr(25);
sql = " update ECustomer set ActivateCode = '" + ActivateCode + "',buildtime = '" + codebuildtime + "' where dataid =" + list[0].DataID;
WebUtility.excutesql(sql);
string Title = "找回您的帐户密码";
string Body = SectionProxyData.GetSetValue(35);
Body = Body.Replace("{username}", list[0].Name);
Body = Body.Replace("{activetime}", codebuildtime);
string url = WebUtility.GetConfigsite() + "/UpdatePassword.aspx?mycode=" + ActivateCode + "&email=" + list[0].EMAIL;
string urlhtml = "<a href='" + url + "'>" + url + "</a>";
Body = Body.Replace("{url}", urlhtml);
SysMailMessage mail = new SysMailMessage(User_Emial, Title, Body);
bool res = mail.Send();
if (res)
{
divError.InnerHtml = "找回密码邮件发送到您的邮箱,请注意查看!";
后面还有 22 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
