protected void btnPassWord_Click(object sender, EventArgs e)
{
//加密
Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection section = config.GetSection("appSetting");
if (section != null && !section.SectionInformation.IsProtected)
{
section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
config.Save();
Response.Write("<script>alert('加密成功');</script>");
}

需要解密文件配置的时候,只需调用SectionInformation类的UnprotectSection方法。

最新文章

  1. 利用WCF创建简单的RESTFul Service
  2. 编译原理LL1文法分析表算法实现
  3. html,移动端代码
  4. HDU 4419 Colourful Rectangle --离散化+线段树扫描线
  5. Interview----判断整数序列是否是二叉搜索树的后序遍历结果
  6. Storm系列(七)架构分析之Scheduler-调度器[DefaultScheduler]
  7. 移动端页面SEO优化需要注意的10个要点
  8. SQL Server 执行计划重编译的两大情况
  9. 流畅python学习笔记:第十七章:并发处理
  10. Django 1.10中文文档-聚合
  11. oracle12c各个版本对其需要的依赖包及系统参数的修改
  12. spring cloud 集群健康监控--turbine-dashboard仪表盘
  13. windows ip路由
  14. [转帖]pfSense软路由系统的使用
  15. 【TCP ZeroWindow】与【TCP window Full】
  16. hikari链接池
  17. is7.5和iis8文件上传大小限制30M修改方法
  18. chrome 浏览器调用 ocx 插件
  19. bzoj 3283 扩展BSGS + 快速阶乘
  20. native关键字(本地方法)、 java调用so动态链接库

热门文章

  1. php 图像处理类
  2. 项目管理实践【六】自动同步数据库【Using Visual Studio with Source Control System to synchronize database automatically】
  3. xfce chrome proxy
  4. redis------del命令
  5. Robot Framework开发系统关键字详细
  6. 第三十九节,python内置全局变量
  7. ocs添加仓库受限问题
  8. ios根据颜色返回图片
  9. mybatis 做 insert操作的时候返回插入的那条数据的id
  10. td里的内容宽度自适应 及 鼠标放上显示标题div title