Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Entity framework 什么';加密实体框架连接字符串的最佳方法是什么?_Entity Framework_Security_Encryption_App Config - Fatal编程技术网

Entity framework 什么';加密实体框架连接字符串的最佳方法是什么?

Entity framework 什么';加密实体框架连接字符串的最佳方法是什么?,entity-framework,security,encryption,app-config,Entity Framework,Security,Encryption,App Config,使用实体框架中的数据库优先方法,使用app.config文件中存储的连接字符串,在部署到生产环境中时,加密或隐藏连接字符串的最佳方法是什么?定义配置文件的位置 Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); 如果要加密连接字符串 config.ConnectionStrings.SectionInformation.ProtectSection(Not

使用实体框架中的数据库优先方法,使用app.config文件中存储的连接字符串,在部署到生产环境中时,加密或隐藏连接字符串的最佳方法是什么?

定义
配置文件的位置

Configuration config  = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
如果要加密
连接字符串

config.ConnectionStrings.SectionInformation.ProtectSection(Nothing);
config.AppSettings.SectionInformation.ProtectSection(Nothing);
您必须了解应用程序配置部分

因此,如果要加密
AppSettings

config.ConnectionStrings.SectionInformation.ProtectSection(Nothing);
config.AppSettings.SectionInformation.ProtectSection(Nothing);

可能重复的可能重复的