C#Windows应用程序记住我复选框 [英] C# windows application remember me check box

查看:139
本文介绍了C#Windows应用程序记住我复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在C#.net Windows应用程序中创建一个登录页面,并且在登录界面中有一个记住我"复选框.有人可以给我一个教程,以编写C#Windows应用程序中的记住我"复选框吗?

我已经厌倦了许多站点编码,但是没有使用,请帮助我..

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..

推荐答案

右键单击您的项目->属性->设置
添加您需要存储在客户端计算机上的变量
例如

名称TYpe范围值
UserName字符串用户
密码字符串用户

然后,例如,要保存登录名"上的首选项",请单击

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

以相同的方式在Window Load或应用程序启动时访问这些值

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

TextBoxUserName.Text = YourProjectNamespace.Properties.Settings.Default.UserName;
TextPassword.Text = YourProjectNamespace.Properties.Settings.Default.Password;


这篇关于C#Windows应用程序记住我复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆