它包含一个唯一的标识符asp.net确认邮件发送链接 [英] asp.net confirmation mail send link that contains a unique identifier

查看:273
本文介绍了它包含一个唯一的标识符asp.net确认邮件发送链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在另一个页面命名为Login.aspx发送包含一个唯一标识一个链接并验证的GUID

I want to send a Link that contains a unique identifier and verify the Guid in an another page named login.aspx

那么,如何添加链接?如何从login.aspx的检索GUID来比较它一个我保存在SQL数据库...

So how do I add the link and how do I retrieve the Guid from the login.aspx to compare it to the one I saved in the SQL database...

这是code

    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

推荐答案

第1步:
你需要把在href完整的URL不只是login.aspx的。结果
例如:HREF =http://nameofmywebsite.com/login.aspx?ID=&放大器; sGUID

Step 1: You need to put the full url in the href not just login.aspx.
Example: "href="http://nameofmywebsite.com/login.aspx?ID="& sGUID"

第2步
在登录页面中,您将检索从您在href通过上面的查询字符串的GUID。
例如:

Step 2 On the login page you would retrieve the GUID from the querystring that you passed in the href above. Example:

request.querystring.get(sGUID)

request.querystring.get("sGUID")

希望这有助于。

这篇关于它包含一个唯一的标识符asp.net确认邮件发送链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆