BP Forums
How to create a change password Button?? - Printable Version

+- BP Forums (https://bpforums.info)
+-- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=55)
+--- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=56)
+---- Forum: VB.NET (Visual Basic 2010/2008) (https://bpforums.info/forumdisplay.php?fid=8)
+---- Thread: How to create a change password Button?? (/showthread.php?tid=501)



How to create a change password Button?? - Himansh - 03-29-2012

I have created an application and have added a login form to it so that If you want to access that application you will first need to enter username and password.
Also i have added a button to main application named "Change Password"
But i dont know how to change the real password of form to the password that user types in "change password" dialog box
So can anybody please help me.

Anyway,
Thanks everybody you hv earlier taken interest in my topics!!!!!!!


Re: How to create a change password Button?? - xolara - 04-02-2012

What kind are you using? are you using a database? or do you use a simple if end if statement? be more specific


Re: How to create a change password Button?? - brandonio21 - 04-02-2012

If you are using an If statement for your password, you could do something like this.
Code:
'Global
public password as string = "pass"
'Login
if textbox1.text = password then
MsgBox("Correct!")
else
Msgbox("Incorrect!")
'Change password (Where textbox2 is your new password)
password = textbox2.text
MsgBox("Password Changed!")



Re: How to create a change password Button?? - Himansh - 04-03-2012

Hi Brandon Milton

Actually your method works but i want that when a user changes the password it permanently changes .
That is
after applying your method when i restarted the application the changed password didn't worked .


And also thanks for replying to my post
-Himansh


Re: How to create a change password Button?? - brandonio21 - 04-03-2012

Well then you're probably going to want to use the same method I mentioned above, but instead of using a local variable, use a Setting. These can be accessed by
Code:
My.Settings.
And can be created in Project>Project Properties>Settings


Re: How to create a change password Button?? - Himansh - 04-04-2012

Hi brandon

I applied your given method and created a new variable called
Password in my projects>properties>settings and entered its value as my default password

Then i replaced "password" with
My.setting.password
Now after installing the application i changed the password but it still don't change after we restart application.

If you don't understand what i am saying then i am mailing you my projects files .
You can yourself check that out .
And also thanks for all the help you have provided to me.

The mail subject will be
My text encryptor


Re: How to create a change password Button?? - brandonio21 - 04-04-2012

Alright, I looked into your project file, and turns out you just needed one line of code that I forgot to tell you about. Just insert this code everytime you change the password
Code:
My.Settings.Save()

That will save all of the settings so they can be used when the application restarts!


Re: How to create a change password Button?? - Himansh - 04-04-2012

Thanxxxxxxxxxxx a Lot buddy.

Now i am also going to add your name in my about box of text encryptor!!
And will also mention your site!!!!

Because without your Invaluable help this project wouldn't have Finished.

Thanks to you again.

-Himansh


Re: How to create a change password Button?? - brandonio21 - 04-05-2012

I am glad to help!