|网页制作|网络编程|图形图象|操作系统|冲浪宝典|软件教学|网络安全|认证考试|通信技术|电子商务|业内动态|书籍教程|原码|
最近更新 文章分类 多媒体类 精品软件
在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 ();