|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
是不是实质都是API?有的好像不只是API那么简单的,有的也是一种框架就像MFC一样。有的还是一种思想(就是做软件的思想)(好像很深奥,其实我也不懂^_^)起首增加援用:usingSystem.Web.Configuration;
加密操纵以下:
[img=1style=,1src=]http://www.ckuyun.com/[/img]以下为援用的内容:privatevoidProtectSection(stringsectionName,stringprovider)
{
Configurationconfig=
WebConfigurationManager.
OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSectionsection=config.GetSection(sectionName);
if(section!=null&&!section.SectionInformation.IsProtected)
{
section.SectionInformation.ProtectSection(provider);
config.Save();
}
}
解密操纵以下:
以下为援用的内容:
privatevoidUnProtectSection(stringsectionName)
{
Configurationconfig=
WebConfigurationManager.
OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSectionsection=config.GetSection(sectionName);
if(section!=null&§ion.SectionInformation.IsProtected)
{
section.SectionInformation.UnprotectSection();
config.Save();
}
}
理论:
加密前的设置文件:
以下为援用的内容:
<?xmlversion="1.0"?>
<configuration>
<appSettings>
<addkey="name"value="shy520"/>
<addkey="address"value="cnblogs"/>
</appSettings>
<system.web>
<compilationdebug="true"/>
</system.web>
</configuration>
加密后的设置文件:
<?xmlversion="1.0"?>
<configuration>
<appSettingsconfigProtectionProvider="DataProtectionConfigurationProvider">
<EncryptedData>
<CipherData>
<CipherValue>
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=
</CipherValue>
</CipherData>
</EncryptedData>
</appSettings>
<system.web>
<compilationdebug="true"/>
</system.web>
</configuration>
另外,小型软件代码重用价值低,没有必要跨平台;大型软件,有严格的规划、部署,不可以随意跨平台。 |
|