我想发送一个包含唯一标识符的链接,并在另一个名为login.aspx的页面中验证Guid
那么如何添加链接以及如何从login.aspx中检索Guid以将其与我在SQL数据库中保存的那个进行比较......
这是代码
Sub emailConfirm()
Dim email As String = txtMail.Text
Dim nom As String = txtPrenom.Text + txtNom.Text
Dim pass As String = txtPass.Text
Dim user As String = txtUserName.Text
Dim mail As MailMessage = New MailMessage()
Dim sGUID As String
sGUID = System.Guid.NewGuid.ToString()
(I will put the guid in the Sql DB)
mail.To.Add(email)
mail.From = New MailAddress("superman@gmail.com")
mail.Subject = "Email Comfirmation de nouvel utilisateur"
Dim Body As String = "Hi " + nom + ", this mail is to confirm your registration" + "Click on the link to confirm your membership please"+"href="login.aspx?ID="& sGUID"(This is not work...)
mail.Body = Body
mail.IsBodyHtml = True
Dim smtp As SmtpClient = New SmtpClient()
smtp.Host = "smtp.gmail.com"
smtp.Port = 587
smtp.Credentials = New System.Net.NetworkCredential("superman@gmail.com", "1234")
smtp.EnableSsl = True
smtp.Send(mail)
End Sub
感谢您的帮助!!!
它在Vb.net
答案 0 :(得分:1)
第1步: 您需要将完整的URL放在href中,而不仅仅是login.aspx 示例:“href =”http://nameofmywebsite.com/login.aspx?ID=“& sGUID”
第2步 在登录页面上,您将从您在上面的href中传递的查询字符串中检索GUID。 例如:
request.querystring.get( “sGUID”)
希望这有帮助。