ASP.NET 2.0 中加密Web.config中的项目
来源:互联网 发布:淘宝网玉器拍卖 编辑:程序博客网 时间:2024/05/08 00:48
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 配置文件
- JS自动关闭父窗口
- 碎片2005
- 汇市中的炒家秘笈
- 举案齐眉,相敬如宾
- AS3.0应用与学习网站 【转】
- ASP.NET 2.0 中加密Web.config中的项目
- Flash8 DataGrid组件性能测试
- Identity and change in the Network Society
- ASP.NET 中一个绑定枚举类型的方法
- 2006 New year New hope
- 除夕夜之前。
- 06/01/28
- 谈谈新手如何学习PHP^_^
- 各位朋友,新年快乐!