实体框架加密连接字符串 [英] Entity Framework Encrypt Connection String

查看:102
本文介绍了实体框架加密连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Entity Framework和Linq to Entities。我想加密连接字符串,而EF必须自动解密,我该怎么做?



提前感谢



Javier P. de Jorge

解决方案

使用aspnet_regiis。在命令行浏览到(通常):

  cd C:\WINDOWS\Microsoft.NET\Framework\v2 .0.50727 

并输入:

aspnet_regiis -pefweb.configpath的sectionName - 加密
aspnet_regiis -pdfweb.config的sectionName路径 - 解密

例如:

  aspnet_regiis -pefconnectionStringsD:\projects\HelloWorldProject

您不需要做任何事情使L2SQL读取加密的连接字符串文件。


I use Entity Framework and Linq to Entities. I want to encrypt the connection string and the EF has to decrypt automaticaly, How can I do it?

Thanks in advance,

Javier P. de Jorge

解决方案

Use aspnet_regiis. In command line browse to (usually):

cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

and type:

aspnet_regiis -pef "sectionName of web.config" "path" - to encrypt
aspnet_regiis -pdf "sectionName of web.config" "path" - to decrypt

For example:

aspnet_regiis -pef "connectionStrings" "D:\projects\HelloWorldProject"

You don't need to do anything to make L2SQL read ecrypted connection string file.

这篇关于实体框架加密连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆