Configuration config = WebConfigurationManager.OpenWebConfiguration("/");
ConfigurationSection appSettings = config.GetSection("appSettings");
if (appSettings.SectionInformation.IsProtected)
{
appSettings.SectionInformation.UnprotectSection();
}
else
{
appSettings.SectionInformation.ProtectSection(
"DataProtectionConfigurationProvider");
}
config.Save();

给config加密的更多相关文章

  1. 对web.config加密,和解密码详细说明

    可以使用受保护配置来加密 Web 应用程序配置文件(如 Web.config 文件)中的敏感信息(包括用户名和密码.数据库连接字符串和加密密钥).对配置信息进行加密后,即使攻击者获取了对配置文件的访问 ...

  2. web.config 加密/解密

    (Aspnet_regiis.exe) 这样的一个工具,可以对站点的.config文件的节进行加密 方法: #> 加密:aspnet_regiis -pef "加密的web.confi ...

  3. Web.config加密和解密

    在系统部署的时候,大家都会遇到关于用户凭证的安全性问题,而对于数据库连接的相关的信息,有些时候客户也需要我们对其加密,防止信息泄露,在此将加密和解的方法记录于此: 首先用管理员的权限启动cmd命令窗口 ...

  4. 加密解密技术—Web.config加密和解密

    阅读目录 一:我们为什么要对web.config配置文件中的配置节加密? 二:怎么样加密和解密? 三:实例 四:运行效果 一:我们为什么要对web.config配置文件中的配置节加密? 因为在我们的项 ...

  5. Web.Config加密与解密

    可以使用受保护配置来加密 Web 应用程序配置文件(如 Web.config 文件)中的敏感信息(包括用户名和密码.数据库连接字符串和加密密钥).对配置信息进行加密后,即使攻击者获取了对配置文件的访问 ...

  6. web.config 加密/解密 正确版

    一般加密方式: 利用Aspnet_regiis: cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 aspnet_regiis -pe "co ...

  7. 说一说ASP.NET web.config 加密及解密方法 (代码)

    /// <summary> /// 保护web.config的加密和解密 /// </summary> public class ProtectHelper { /// < ...

  8. 创建自己的RSA密钥来保护web.config 加密数据库连接字符串

    通过创建自己的RSA密钥来保护web.config1创建RSA密钥:C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis - ...

  9. win10 IIS web.config加密不能访问:打不开 RSA 密钥容器

    C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys 找到密钥文件, 根据时间判断具体是哪一个文件,赋予network service读权限

随机推荐

  1. webpack ,react

    一小时包教会 —— webpack 入门指南 http://***/Article/50764   ------------------ 轻松入门React和Webpack http://www.in ...

  2. NSNotificationCenter基础知识

    NSNotificationCenter基础知识   Notification的工作机制 1.对应用程序中其他地方发生的事件(比如增加一条数据库记录)感兴趣的对象,会向通告中心(Notificatio ...

  3. android系统自带的Service原理与使用

    1. 说明 android的后台运行在很多service,它们在系统启动时被SystemServer开启,支持系统的正常工作,比如 MountService监听是否有SD卡安装及移除,Clipboar ...

  4. LeetCode_Restore IP Addresses

    Given a string containing only digits, restore it by returning all possible valid IP address combina ...

  5. Some General concepts in ISO C

    [ISO C11 Clause 3]对象(object):执行环境中数据存储的一块区域,它的内容可以用来表示值.-注释:对象可以具有特定的类型.--值(value):确定类型的对象的内容的确切含义.- ...

  6. Linux 删除空行

    在Linux上处理一些数据文件时,有时候需要将其中的空行过滤掉,系统中提供的各种工具都可以完成这个功能.将常用的介绍如下吧:1. grep grep . data.txt grep -v '^$' d ...

  7. javascript 典型闭包的用法

    <body><input type="radio" id="radio1" name="readionGroup" /&g ...

  8. Permutations 解答

    Question Given a collection of numbers, return all possible permutations. For example,[1,2,3] have t ...

  9. 玩转指针(Playing with Pointers)

    Question: What is a Pointer? What are its limitations? What are its benefits? How do we use it? What ...

  10. strcat函数的坑点

    我们先看下面这样一段代码: #include <iostream> #include <stdlib.h> using namespace std; int main() { ...