您的位置:首页 >> Web开发 >> ASP.NET >> ASP.Net技巧 >> 正文
RSS
 

asp.net 2.0中加密web.config

http://www.rdxx.com 06年05月02日 01:35 网络 我要投稿

关键词: 加密 , Web.config , ASP.NET , .NET , ASP , Web

在asp.net 2.0中,可以很方便地加密web.config文件里的敏感信息了.比如如果有权限操作服务器的话,
可以用下面的方法加密web.config里的敏感信息,比如要加密数据库连接串
aspnet_regiis -pe "connectionStrings" -app "/应用程序的名字"

如果没权限的话,可以在程序里动态实现

Configuration config = Configuration.GetWebConfiguration(Request.ApplicationPath);
ConfigurationSection section = config.Sections["connectionStrings"];
 section.ProtectSection ("DataProtectionConfigurationProvider");
 config.Update ();


 
 
标签: 加密 , Web.config , ASP.NET , .NET , ASP , Web 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站