在 .NET 中以编程方式加密配置文件 [英] Programmatically encrypting a config-file in .NET
问题描述
有人可以简要介绍一下如何在 .NET 中以编程方式加密配置文件,最好是在 C# 中.
Could somebody please do a rundown of how to programmatically encrypt a config-file in .NET, preferably in C#.
我想做的是对应用程序的启动进行某种检查,以查看某个部分是否不受保护,如果是,则对其进行加密.这适用于设置和连接字符串.
What I would like to do is do some kind of check on an application's startup to see if a section is unprotected, and if it is, then encrypt it. This for both settings and connection-strings.
另外,如果有人可以列出加密提供程序的类型以及它们之间的区别.
Also if anyone could list the types of encryption-providers and what is the difference between them.
我不知道在普通 WinForms 应用程序中执行此操作的代码是否对 ASP.NET 中执行此操作透明.
I don't know if the code for doing this in a normal WinForms-application is transparent to doing this in ASP.NET.
推荐答案
为了总结答案以及我目前发现的内容,这里有一些很好的链接来回答这个问题:
To summarize the answers and what I've found so far, here are some good links to answer this question:
请随意补充其他链接,也许是 WinForms 或 WPF 应用程序的一些链接.
Please feel free to complement with other links, maybe some to WinForms- or WPF-applications.
这篇关于在 .NET 中以编程方式加密配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!