资 源 简 介
保护无效 substring () {SqlConnection conSplit = 新 SqlConnection (ConfigurationManager.ConnectionStrings ["connMSJ"]。ConnectionString) ;SqlCommand cmdSplit = 新 SqlCommand ("选择密码从成员哪里 (Username=@username 和 Email=@email)",conSplit) ;cmdSplit.Parameters.AddWithValue ("@username",txtUsername.Text);cmdSplit.Parameters.AddWithValue ("@email",txtEmail.Text);conSplit.Open() ;使用 dtrSplit = cmdSplit.ExecuteReader() ;如果 (dtrSplit.Read()) finalString = dtrSplit ["密码"]。Tostring ()。子串 (0,5) ;dtrSplit.Close() ;conSplit.Close() ;} 保护 void sendResetPass() {MailMessage mailMessage = 新 MailMessage() ;mailMessage.To.Add(txtEmail.Text) ;mailMessage.From = 新邮件地址 ("admin@MSJ.com") ;mailMessage.Subject ="的密码重置";mailMessage.Body ="新的密码:"+ finalString ;SmtpClient smtpClient = 新 SmtpClient("smtp.your-isp.com") ;smtpClient.Send(mailMessage) ;} 保护 void ResetPassword (对象发件人、 EventArgs e) {substring () ;如果 (finalString! = null) {SqlConnection conReset = 新 SqlConnection (ConfigurationManager.ConnectionStrings ["connMSJ"]。