asp.net2.0.如何加密数据库联接字符串.
【在线QQ讨论群】[url]
[url=http://www.now.cnindexr.phpr=!bbstoudeng] 美容
在.asp.net2.0中,发布网站时,加密web.config,这样可以有.效保证数据库用户和密码安全,其步骤如下.
1.添加密钥
执行cwindowsmicrosof..t.netframeworkv2.0.50727aspnet_regiis -pc hnlaw -exp服务器
其中hnlaw为密钥名称
2.添加we.b.config节点 健康
在web.conf.ig的config.urationconfiguration之间添加 杀毒
c.onfigprotecteddata电影
providers
add keyconta.inername=hnlaw. usemachinecontainer=true desc.ription=uses rsacryptoserviceprovider to encrypt and 电脑
decrypt name=hnlaw type=.system..configuration.rsaprotectedconfigurationprovider,system.configuration, version=2..0.0.0, 域名
culture=neutr.al, publickeytoken=b03f5f7.f11d50a3a 外汇
providers
configprotectedda.ta.
注.意这里keycontainername=hnlaw和name=hnlaw分别表示你.的密钥名称;<性病>
3.加密web.config
到网站根目.录添加一个批处.理文件enweb.bat,内容如下虚拟主机
@echo off
cwindowsmicrosoft.netframewor..kv2.0.50727aspn.et_regiis -pef system.webidentity ehs studiodonet2hnlawyer -prov 女人
hnlaw
cwindowsm.icrosoft.netframeworkv2.0.50727aspn.et_regiis -pef connectionstrings ehs studiodonet.2hnlawyer -prov 杀毒
hnlaw
pause
注册上面的的路径和名称!
运行后出现成功!
4.解密
同样到网站根目录添加一个批处理文件d.ew.eb.bat,内容如下( 游戏 )
@echo off
cwindowsmicrosoft.netframeworkv2.0.50727aspn.et_regiis -pef system.webidentity e.hs studiodonet2hnl.awyer服务器
cwindowsmicrosoft.netfram.ewor.kv2.0.50.727aspnet_regiis -pdf connectionstrings ehs studiodonet2hnlawyer.
pause
最后就是要注意做完后.找到cdocuments and settingsall usersa.pplication datamicrosoftcr.yptorsamachinekeys目录下,找到生成 乙肝
的密钥文件(可按时间查找),给上network service可读取权限,不然会出现error message fr.om the provider the rsa ke.y con.tainer could 投资
not be opened.无.法读取 建材
[url]
更多详情请到
[url]http://www.now.cn/indexr.php?r=!bbstoudeng[成人用品]
关键词.:as.p主机,主机,虚拟主机,java虚拟主机,java空间投资