In context of computer
system, once another person acquire your password he/she can use your computer.
They can even use your computer to attack another machines. If he/she do this,
it will look like you do anything.
The same can be applied to
our applications, if one acquire application’s password then he/she can modify
or remove something, to harm you. That’s why we should change
the password periodically in order to ensure the security of computer/application.
We have to follow some steps
to change the password:
Step 1
After creating login control add another form i.e.
Change password, and pass the username
from login form to this form using constructor.
Step 2
Add three textboxes into new
form. One for old password, second for new password and third will be used for
comparing new password. Add a button and generate click event of that button.
Step 3
Write following code in click
event of button
In above code, check the user
is correct and also entered the equal values in confirm password and new
password textbox. If both conditions are
satisfied then, assign the user a new password that is in new password textbox.
And finally save the changes in database.
Download source.