DataTable dt = sqlhelper。ExecuteDataTable(id);
if (dt。Rows。Count > 0){
DataRow dr = sqlhelper。ExecuteDataRow(id);
Session["id"] = dr["CustomerID"];
Session["name"] = name;
Response。Redirect("SubmitData。aspx"); }
}
if (string。IsNullOrEmpty(chlist。SelectedItem。Text))
{
Response。Write("<script>alert('请选择是客户还有员工!')</script>");
return;
}
else
{ Response。Write("<script>alert('用户名或密码错误!')</script>");
return;
}
遗忘登录密码:通过邮件发送密码:
string email = @"select Email,Password from t_Customer where CustomerName='" + txtusername。Text + "'";
DataRow dr=sqlhelper。ExecuteDataRow(email);
string ToEmail = dr["Email"]。ToString();
string Passwod=dr["Password"]。ToString();
SmtpClient smtpClient = new SmtpClient();
smtpClient。EnableSsl = true;
smtpClient。UseDefaultCredentials = false;
smtpClient。DeliveryMethod = SmtpDeliveryMethod。Network;//指定电子邮件发送方式
smtpClient。Host = "smtp。qq。com "; //指定SMTP服务器
smtpClient。Credentials=new System。Net。NetworkCredential("422441455@qq。com", "jcshprpykhpscagj");//用户名和授权码
MailMessage mailMessage = new MailMessage("422441455@qq。com", ToEmail); // 发送人和收件人
mailMessage。Subject = "地税申报";//主题
mailMessage。Body = "您的登录密码为:"+Passwod;
mailMessage。BodyEncoding = System。Text。Encoding。UTF8;//正文编码