在 app.config 中加密连接字符串 [英] Encrypt connection string in app.config
问题描述
我在 app.config 中加密连接字符串时遇到问题.我有代码可以保护 app.config 的 connectionStrings 部分,但密码仍以纯文本形式显示.
I am having trouble encrypting a connection string in app.config. I have code that will protect the connectionStrings section of app.config, but the password is still displayed in plain text.
我需要加密连接字符串,以便在部署时它不是纯文本.我看到关于 web.config 的 SO 类似问题,但没有看到 app.config.
I need to encrypt the connection string in so it is not in plain text when deployed. I see similiar questions on SO for web.config, but not app.config.
推荐答案
看看 这篇文章 它有一些非常有用的例子.您基本上是在寻找 System.Configuration.SectionInformation.ProtectSection
来帮助您.
Have a look at This Article it has some very useful examples. You're basically looking for System.Configuration.SectionInformation.ProtectSection
to help you out here.
另请查看实施受保护的配置
这篇关于在 app.config 中加密连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!