2
A
回答
1
由于web.config中是受保护的文件会有它没有直接联系。您可能会很好地将连接凭据存储在那里。
但是 - 你可以去远一点和你的web.config加密的appSettings
Walkthrough: Encrypting Configuration Information Using Protected Configuration
0
的配置文件将是一个理想的地方保存有关数据库credential.But的细节,如果你是担心其存储在纯文本中的安全性,然后在asp.net中,您可以加密webconfig文件的特定部分.Encyption可以通过提供相关命令行参数来使用aspnet_regiis.exe实用程序完成。否则,加密可以也可以通过代码在“WebConfigurationManager”的帮助下完成。您还可以为了读取该部分中的配置设置,不需要解除部分的保护,运行时将执行解密,以便应用程序读取纯文本值。
E.g: - ASPNET_REGIIS.EXE
C:\>aspnet_regiis -pdf "connectionStrings" "C:\Projects\My Site"
这里PDF参数用于指定文件路径。
E.g: - 使用WebConfigurationManager
protected void toggleEncryption(object sender, EventArgs e)
{
Configuration config;
config = WebConfigurationManager.OpenWebConfiguration("~");
ConnectionStringsSection section;
section = config.GetSection("connectionStrings")
as ConnectionStringsSection;
if (section.SectionInformation.IsProtected)
{
section.SectionInformation.UnprotectSection();
}
else
{
section.SectionInformation.ProtectSection(
"DataProtectionConfigurationProvider");
}
config.Save();
WriteMessage("connections protected = " +
section.SectionInformation.IsProtected);
}
相关问题
- 1. ASP.NET Web应用程序设计工具
- 2. 设置为ASP.NET Web应用程序
- 3. ASP.NET Web应用程序Azure设置
- 4. ASP.NET Core Web应用程序的Web.config设置作为ASP.NET Core Web应用程序中的子应用程序?
- 5. ASP.NET MVC Web应用程序VS ASP.NET Web应用程序
- 6. 反向工程asp.net web应用程序
- 7. 使用SQL和XML源设置ASP.NET MVC3 Web应用程序
- 8. asp.net web应用程序
- 9. web应用程序的应用程序设置
- 10. ASP.NET web应用程序
- 11. 在SharePoint Web应用程序和ASP.NET Web应用程序之间传递用户凭据
- 12. asp.net web应用程序更新程序
- 13. ASP.NET MVC Web应用程序与Web应用程序
- 14. asp.net mvc 2 web应用程序里面的Web应用程序?
- 15. Web应用程序设计
- 16. asp.net web应用程序性能测试工具和教程
- 17. 设置和部署Web应用程序
- 18. Asp.net的web应用程序
- 19. web应用程序asp.net
- 20. ASP.NET Web应用程序
- 21. ASP.NET Web应用程序SQL Server CE数据库配置错误
- 22. Embedable小工具在ASP.Net应用程序
- 23. 工具测试Web应用程序
- 24. Web应用程序入门工具包
- 25. Web应用程序:RAP工具包
- 26. ASP.NET应用程序开发 - 工具
- 27. 从Web应用程序(ASP.Net)远程控制Android应用程序
- 28. 凭证从.NET Web应用程序
- 29. Web应用程序的“简单”安装程序(IIS虚拟应用程序+ sql服务器数据库设置)
- 30. 您使用什么工具在Asp.net或Asp.net mvc中设计Web应用程序?
感谢web.conf是不够好。我其实虽然你有访问web.conf? – iamjonesy 2010-04-06 08:42:21