All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
JS实现图片无缝滚动的完美解决_JavaScript技术_编程技术
如何禁止flash动画的自动跳转_JavaScript技术_编程技术
HTML 初学者指南(2)_[Html教程]
我国互联网营销的发展与创新_百度优化_seo学堂
ASP.NET,2.0移动开发之属性重写和模板化_.net资料_编程技术
PHPUnit袖珍指南之PHPUnit的目的_[PHP教程]
JScript中正则表达式用法详解_JavaScript技术_编程技术
利用.net反射动态调用指定程序集的中的方法_[Asp.Net教程]
ASP和ASP.NET共用Cookies问题_[Asp.Net教程]
动态网页常用技术:用PHP追随变量(cookie和session)_php资料_编程技术
Reading number is top 10 pictures
Ashlynn Brooke photograph of a group3
Men don't mature ten sign
In the world the most mysterious 21 place landscape4
这玉米,买还是不卖?
到南昌西站了1
这才是真正的人体艺术3
一个武林高手的故事
Startling Russian girl blind date scene2
The hot big eye big breast beauty2
The real super beauty4
Download software ranking
Boxer's Top ten classic battle6
asp.netWeb服务器高级编程
Tram sex maniac 2 (H) rar bag13
Unix video tutorial12
传奇私服架设教程-chm
Adobe Flash Player(IE) 10.0.32.18 浏览器专用的FLASH插件
打鸟视频
C++编程教程第三版
好色的外科大夫
Unix video tutorial13
delv published in(发表于) 2014/1/6 9:01:20 Edit(编辑)
ASP.NET2.0中配置文件的加密与解密_[Asp.Net教程]

ASP.NET2.0中配置文件的加密与解密_[Asp.Net教程]

ASP.NET2.0中配置文件的加密与解密_[Asp.Net教程]

首先添加引用:


using System.Web.Configuration;


加密操作如下:


private void ProtectSection(string sectionName, string provider)
{
Configuration config =
WebConfigurationManager.
OpenWebConfiguration(Request.ApplicationPath);


ConfigurationSection section = config.GetSection(sectionName);


if (section != null && !section.SectionInformation.IsProtected)
{
section.SectionInformation.ProtectSection(provider);
config.Save();
}
}


解密操作如下:


private void UnProtectSection(string sectionName)
{
Configuration config =
WebConfigurationManager.
OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection section = config.GetSection(sectionName);
if (section != null && section.SectionInformation.IsProtected)
{
section.SectionInformation.UnprotectSection();
config.Save();
}
}


实践:
加密前的配置文件:












加密后的配置文件:








AQAAANCMnd8BFdERjHoAwE/Cl+s
BAAAABi1ATlNkEUGEf0XyWGL2Xg
QAAAACAAAAAAADZgAAqAAAABAAA
ABIhxMWlazAntwIIpST1CDXAAAA
AASAAACgAAAAEAAAAPz/YKYx07c
b+h4fqdr4fkLgAAAAX1Ieyc+WSx
AfsDW1vn2C/fXsG2TAnYeUgaCov
8e3nGFTHHsH91gLiqKregFPYzGR
vW1xrez/3VwOmJI9eS7EFKrcXej
NnHL66kg2iNRk3ntLNZlZtTs3cZ
9w63u47VKAjs6miWsGBz2GntL/9
UGHLELigrJcr3YJ+lsjOscExQnv
HGvA48EfxpD+tEiFBtgXeHsFkQX
cqGySshx16vCt2GUNUC3ZmEAhBh
UsAFkPIYqelYHd4+m9a/xPe2tqw
GIbla1wbW2NDEfrzJPwnkfmpNqR
hXijKImipwXbDVYy6o0UAAAAs8D
suYNOhJ7qAjJa2c/4eUC7sks=








来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.