web.config数据库连接代码被加密,如何修改连接到自己新的数据库上?
时间:2011-12-15
来源:互联网
web.config连接代码如下,因为更换了数据库,请问如何修改才能连接到自己新的数据库,谢谢!!
XML code
XML code
<configProtectedData> <providers> <add name="ProtectConnections" type="Industry.Platform.Components.Security.ProtectConnections, Industry.Platform.Components, Version=3.0.6.3, Culture=neutral, PublicKeyToken=8ea6ab7213fe50fe, processorArchitecture=MSIL"/> </providers> </configProtectedData> <!-- <connectionStrings configProtectionProvider="ProtectConnections"> <EncryptedData> <CipherData> <CipherValue>0C30ABEDA0C9ECE381B8224C5EFB3加密代码很长,提示有非法字符,无法全部上传!!</CipherValue> </CipherData> </EncryptedData> </connectionStrings>
作者: fangsky 发布时间: 2011-12-15
这个不是数据库连接代码吧
应该是这样:
<configuration>
<appSettings>
<add key="con" value="data source=.;database=你的数据库名;uid=用户名;pwd=密码"/>
</appSettings>
</configuration>
应该是这样:
<configuration>
<appSettings>
<add key="con" value="data source=.;database=你的数据库名;uid=用户名;pwd=密码"/>
</appSettings>
</configuration>
作者: wanghaidong3 发布时间: 2011-12-15
然后在业务逻辑层调用:
SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["con"]);
sqlcommand cmd=new sqlcommand (sql语句,conn);
SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["con"]);
sqlcommand cmd=new sqlcommand (sql语句,conn);
作者: wanghaidong3 发布时间: 2011-12-15
原来用啥加密的,再加密一次呗
作者: JulioHuang 发布时间: 2011-12-15
C# code
加密过了,在加密一次,晕!!继续等待解答
<configProtectedData> <providers> <add name="ProtectConnections" type="Industry.Platform.Components.Security.ProtectConnections, Industry.Platform.Components, Version=3.0.6.3, Culture=neutral, PublicKeyToken=8ea6ab7213fe50fe, processorArchitecture=MSIL"/> </providers> </configProtectedData> <connectionStrings configProtectionProvider="ProtectConnections"> <EncryptedData> <CipherData> <CipherValue>0C30ABEDA0C9ECE381B8224C5EFB3加密代码很长,提示有非法字符,无法全部上传!!</CipherValue> </CipherData> </EncryptedData> </connectionStrings>
加密过了,在加密一次,晕!!继续等待解答
作者: fangsky 发布时间: 2011-12-15
找个md5加密网站,把你的密码用它加密,再放到这里面啊
作者: HHQSY 发布时间: 2011-12-15
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28