Often, a user is required to type i
Often, a user is required to type i
(OP)
Often, a user is required to type in his email address in the case of a forgotten password. A message is sent to that address with a link for the user to click on in order to reset his password. I have something like this:
How is that link generated, please? How would I begin to code it?
Thanks.
CODE --> VB.NET
Using conn As New OleDbConnection(ConnectionString) Using cmd As OleDbCommand = conn.CreateCommand() cmd.CommandText = "UPDATE university SET uniqueCode = @uniqueCode WHERE strEmail = @strEmail" cmd.Parameters.AddWithValue("@uniqueCode", uniqueCode) cmd.Parameters.AddWithValue("@strEmail", strEmail.Text.Trim()) conn.Open() Dim recordsAffected As Integer = cmd.ExecuteNonQuery() If recordsAffected <> 0 Then recordExists = True End Using End Using If recordExists Then Dim builder As New UriBuilder(Request.Url) builder.Path = VirtualPathUtility.ToAbsolute("~/resetPwd.aspx") builder.Query = "uniqueCode=" & HttpUtility.UrlEncode(uniqueCode) Dim link As String = builder.Uri.ToString() ' Eg: http://localhost:2464/SampleApplication/ResetPasswordVB.aspx?uniqueCode=ee3106b4df694555b4ca6f2727a23dc8 SMTP code here
How is that link generated, please? How would I begin to code it?
Thanks.
RE: Often, a user is required to type i
RE: Often, a user is required to type i
I just wondered in which format
CODE -->
The link above, that is, http://localhost:2464/SampleApplication/ResetPassw... is not mine.
Thanks again.
RE: Often, a user is required to type i
From what I see of your code, it is doing what it is supposed to do. So, what exactly is the problem/question?