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