Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wrıte a program ın wındows app. admın form has a textbox and a button you enter your password and clıck the button if you want to open program you wrıte your password but every open your program always ı must wrıte password .ı want to do thıs program remember my password how can ı do whıch textbox event? ı want to textbox hold my password
Posted
Updated 27-Jun-10 21:24pm
v2
Comments
rohinideepoo 28-Jun-10 3:43am    
Sorry,your question is not clear.. i think you want to remember your password for each login..

You need to preserve application information:
1) In the solution explorer, under your project window, properties, double click on "Settings.settings"
2) Add a new setting. Name: userPassword, Type: string, Scope: User
3) In your form Load event, add:
Properties.Settings.Default.Reload();

4) Then add:
tbPassword.Text = Properties.Settings.Default.userPassword;

5) Finally, when you accept the user login:
Properties.Settings.Default.userPassword = tbPassword.Text;
Properties.Settings.Default.Save();

The advanced stuff is to save the password as an SHA hash rather than plain text - but that is for when you have more idea what you are doing... :laugh:
 
Share this answer
 
It would be a new control, a checkbox that can be used. If checked then remember the password (save it safely encrypted on client system or so).

Next time onwards, check if the password is present for the given username, if so load it in the textbox through code.
 
Share this answer
 
You'll want to use
textbox.text = [LOADED PASSWORD]
in the
Form.Loaded
event. If you are unsure on how to do this, when you are in the designer, double click the titlebar, all code you enter in there will automatically be run when the form opens.
 
Share this answer
 
Use a checkbox for 'Remember Me'.
Check whether the checkbox is checked or not in the 'Login' button click.
If it is checked, then store the textbox(password) value in to a cookie.
You can set how many days you want to remember the password by using cookie properties.
Then check whether the coockie is null or not in the Login Page_Load event.
If it has value, then set the textbox value with cookie value and set the checkbox checked is true.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900