Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i am creating a login page in C#.net windows application and i have a remember me checkbox in the login interface. can some one give me a tutorial to code the remember me check box in the C# windows application

i have tired many sites coding but not use please help me any one..
Posted
Updated 31-May-17 4:31am
Comments
Sergey Alexandrovich Kryukov 20-Feb-13 0:11am    
Check box is a check box, how can it need a tutorial?
—SA
boogac 20-Feb-13 4:50am    
sergey is right,you are probably having problems with your algorithm not your check box?

1 solution

Right click on your project -> Properties -> Setting
Add your variable which you need to store on client machine
For example

Name TYpe Scope Value
UserName String User
Password String User

Then For example you want to save Preference on Login button click

If(CheckboxRemember.checked)
{
YourProjectNamespace.Properties.Settings.Default.UserName = TextBoxUserName.Text;
YourProjectNamespace.Properties.Settings.Default.Password = TextPassword.Text;
YourProjectNamespace.Properties.Settings.Default.Save();
}

On the same way Access These value on Window Load or application startup

C#
TextBoxUserName.Text = YourProjectNamespace.Properties.Settings.Default.UserName;
TextPassword.Text = YourProjectNamespace.Properties.Settings.Default.Password;
 
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