当前位置:首页 > 软件开发 > dev
firefox

asp.net 2.0中加密web.config

在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 ();

 ↓相关文章:
© 2006-2008 All Rights Reserved