加密和解密web.config文件中的连接字符串 [英] encrypt and decrypt connectionstring in web.config file

查看:77
本文介绍了加密和解密web.config文件中的连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个需要对 web.config文件
中的连接字符串进行加密和解密的应用程序
就像我有登录和注销页面一样.

所以我不知道将登录凭据加密和解密放在哪里
所以我在登录页面和
上放置了密码 解密注销页中的代码

这样放置是否正确?

还有另外一件事,如果我对其进行动态加密会更改web.config文件,因此我的所有会话值都变为空 为什么?

这是我的连接字符串

 < connectionStrings><添加名称="Conn" connectionString ="DataSource = northwind; server = myserver;用户ID = test; Password = test" providerName ="System.Data. SqlClient"/></connectionStrings>  


谢谢
Srinivas

解决方案

请查看以下过去答案:
如何管理加密的appSettings和connectionString? /a> [ ^ ],
加密数据库密码并解密,同时动态地形成连接字符串 [ ^ ].

—SA


您可能还想看看以下链接:
用于加密配置节的MSDN文章 [使用asp.net加密或解密web.config文件中的连接字符串. [ ^ ]
how-to-encrypt-connection- string-in-web.config [ ASP.NET 2.0中Web.config内部的连接字符串的加密 [ ^ ]
使用asp.net加密或解密web.config文件中的连接字符串. [ ^ ]

如何在web.config中加密连接字符串 [^ ]

Web.config加密 [在web.config文件中加密连接字符串 [<connectionStrings><add name="Conn" connectionString="DataSource=northwind;server=myserver;User ID=test;Password=test"providerName="System.Data.SqlClient" /></connectionStrings>


Thanks
Srinivas

解决方案

Please see these past answers:
How do I manage encrypted appSettings and connectionStrings?[^],
Encrypting the database password and decrypting while forming the connection string dynamically[^].

—SA


You may also want to have a look at following links:
MSDN Article for Encrypting Config Sections[^]
Encrypt or Decrypt Connection Strings in web.config file using asp.net.[^]
how-to-encrypt-connection-string-in-web.config[^]


Please refer
CP Articles:
Encryption of Connection Strings Inside the Web.config in ASP.NET 2.0 [^]
Encrypt or Decrypt Connection Strings in web.config file using asp.net.[^]

How to Encrypt connection string in web.config[^]

Web.config Encryption[^]
This tutorial will gives you details about encrypting the contents to protect them from prying eyes.

Encrypting Connection Strings in web.config file[^]


这篇关于加密和解密web.config文件中的连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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