IS 341: Project 13 Solution
0 HW points, 30 PDP points


Homework

There was no homework portion to this assignment.

Personal Database Project

Here's the change password page from the Acme website:

The code that lies behind this page is as follows. Note that it encrypts the password before loading it into the database.

Private Sub ChangeBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChangeBtn.Click
    If (NewPasswordTxt.Text = "") Then
        Feedback.Text = "Please enter a password..."
    ElseIf (NewPasswordTxt.Text = RepeatedPasswordTxt.Text) Then
        Try
            Me.SqlUpdateCommand1.CommandText = "UPDATE Customers SET password='" + _
                        System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(NewPasswordTxt.Text, "md5") + "' " + _
                        "WHERE loginID='" + Session("loginID") + "'"
            Me.SqlUpdateCommand1.ExecuteNonQuery()
            Feedback.Text = "Password Changed for user " + Session("loginID")
        Catch
            Feedback.Text = Me.SqlUpdateCommand1.CommandText
        End Try
    Else
            Feedback.Text = "Passwords must match..."
    End If
End Sub

Last modified: Fri Dec 12 10:25:11 Eastern Standard Time 2003
© 2003 Calvin College