ASP.NET 2.0 中加密Web.config中的项目
来源:互联网 发布:java增删改查实例项目 编辑:程序博客网 时间:2024/06/09 17:05
ASP.NET 2.0给我们带来不少安全性方面的改进,让我们的Web应用越来越安全。在ASP.NET项目中我们的数据库链接字符串都大多写在了Web.config的文件中,数据库用户密码一览无余,这样显然是不安全的。我们可能自己动手写了一些加密解密算法来加密,现在好了在ASP.NET 2.0中系统为我们提供了这样的功能。
<connectionStrings>
<add name="Pubs" connectionString="Server=localhost;Integrated Security=True;Database=Pubs"
providerName="System.Data.SqlClient" />
<add name="Northwind" connectionString="Server=localhost;Integrated Security=True;Database=Northwind"
providerName="System.Data.SqlClient" />
</connectionStrings>
我们如果有操作Web Server的权限,我们可以不用Coding来加密,直接使用命令行
aspnet_regiis -pe "connectionStrings" -app "/SampleApplication"
如果我们没法操作Web Server的话只好采用代码方法
Configuration config = Configuration.GetWebConfiguration(Request.ApplicationPath);
ConfigurationSection section = config.Sections["connectionStrings"];
section.ProtectSection ("DataProtectionConfigurationProvider");
config.Update();
加密后我们看到
<connectionStrings>
<EncryptedData>
<CipherData>
<CipherValue>AQAAANCMndjHoAw...</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>
- ASP.NET 2.0 中加密Web.config中的项目
- ASP.NET 2.0 中加密Web.config中的项目
- asp.net 2.0中加密web.config
- asp.net 2.0中加密web.config
- asp.net 2.0中加密web.config /App.config
- asp.net 2.0中加密web.config /App.config
- asp.net 2.0 中加密web.config 文件中的配置节
- asp.net 2.0 中加密web.config 文件中的配置节
- ASP.NET 2.0加密Web.config 配置文件
- ASP.NET 2.0加密Web.config 配置文件
- ASP.NET 2.0加密Web.config 配置文件
- ASP.NET 2.0加密Web.config 配置文件
- ASP.NET 2.0加密Web.config 配置文件
- ASP.NET 2.0加密Web.config 配置文件
- Asp.Net 2.0加密Web.config配置文件
- ASP.NET 2.0加密Web.config 配置文件
- ASP.NET 2.0加密Web.config 配置文件
- ASP.NET 2.0加密Web.config 配置文件
- [推荐]CLabel--超强CStatic静态框
- 一个关于ADO访问数据库实现分页
- 常用sql语句
- Solaris admin-commands
- 结合struts和hibernate谈J2EE架构的数据表示
- ASP.NET 2.0 中加密Web.config中的项目
- 正则表达式入门
- 如何使Struts的本地信息文件ApplicationResources.properties支持中文
- java不是天生低能
- 去掉字符串空格
- UNIX 共享内存应用中的问题及解决方法
- NFS ( Network FileSystem ) (转)
- 共享内存应用中的问题及解决方法
- JSTL语法及参数