如何在WPF项目的app.config中添加凭据? [英] How to add credential in app.config in wpf project?

查看:101
本文介绍了如何在WPF项目的app.config中添加凭据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想在app.config中手动添加我的帐户凭据,然后我要在后面的代码中从app.config中读取我的凭据..

请帮助thanx ...

sumitk

Hi all,

i want to add my Account Credentials in app.config manually and after that i want to read my credential from app.config in code behind..

plz help thanx...

sumitk

推荐答案

嘿,

我们得到了您想要的,很好.但是,您面临的问题是什么?你尝试了什么?是什么阻止了您做自己想做的事情? :S

我们不是在这里为您提供解决方案和编写代码,而是在您遇到问题时尝试为您提供帮助.

只需看一下下面的链接并弄清楚逻辑即可:

如何:使用ConfigurationSection创建自定义配置节 [ ^ ]
在C#中创建自定义配置部分 [ ^ ]

祝你好运
Hey there,

We got what you want, fine. But what''s the problem you are facing? What have you tried? What is stopping you from doing what you want? :S

We are not here to provide solutions and write code for you, we are here to try and help you out when you are stuck in a problem.

Just take a look at below links and work out a logic:

How to: Create Custom Configuration Sections Using ConfigurationSection[^]
Creating a Custom Configuration Section in C#[^]

Good luck, regards




除了在配置文件中添加凭据外,我建议您也对信息进行加密.在配置文件中存储纯文本可能会导致重大安全问题. Solution1 alreay为您提供了更新配置文件的链接,因此请尝试在存储之前对凭据进行加密.

谢谢.
Hi,

Along with adding credential in configuration file, i suggest you to encrypt information as well. storing plain text in configuration file may cause major security issue. Solution1 alreay gives you links to update your configuration file so try with that also encrypt the credential before storing.

Thanks.


这篇关于如何在WPF项目的app.config中添加凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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