选中复选框时如何保存用户名和密码 [英] how to save username and password when checkbox is checked

查看:83
本文介绍了选中复选框时如何保存用户名和密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我正在设计一个登录表单-(使用C Sharp和MS SQL Server的Windows应用程序).

我想要如何保存登录数据的逻辑和代码,以便在用户下次返回时能够找到为他编写的所有可用用户名和密码.

我知道可以通过将登录数据存储在app.config
中来完成 您能否显示写入xml文件app.config并从中检索所需的用户名和密码的方式.
请给我存货Google既没有帮助我也没有来自codeprject的搜索结果.

如果您中的某人使用上述要求在代码中加上注释并编写注释以了解发生什么事情,那将是很棒的事情

Hello
i am designing a Login form---(windows application using C sharp and MS SQL server).

i want the logic and code how to save the login data so that when user returns next time he finds all ready username and password written for him.

i know that this can be done by storing the login data in app.config
can you show the way of writing to xml file app.config and then retreiving the needed username and password from it.
please i am stocked Google is not helping me neither the search results from codeprject.

it would be great if someone of you makes a loginform with the above requirments with comments in code to understand whats happining

Thanks

推荐答案

不要为此使用app.config文件.您将需要与数据库中的登录信息相关联的当前用户名,然后在您的应用程序启动时,您可以根据用户名检索该信息
Don''t use the app.config file for this. You would need the current user name associated with the login information in the database, then when your app starts up you can retrieve the information based on the user name


任何人都可以给我们提供示例项目?

请...
can anybody give us a sample project ?

please...


您可以使用.Net的 Settings 对象
您可以通过添加新项目来添加自己的设置对象,也可以直接在项目属性的设置"选项卡中添加

可以将数据存储为数据库而无需任何查询或XML语法

:)
you can use Settings object of .Net
you can add your own setting object by adding new item or you can directly add in your Project Properties''s Settings tab

which can able to store data as database without any query or XML syntax

:)


这篇关于选中复选框时如何保存用户名和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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