首 页 ASP ASP.NET PHP JSP Ajax DIV+CSS JavaScript XML C#
MySQL MSSQL Access Oracle Linux Server 电脑技巧 网络安全 建站经验 其它

ASP.NET 2.0中配置文件的加密与解密

整理日期:2009年04月17日 【字体:

  首先添加引用: 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();
    }
  }

  解密操作如下:


伊图教程网[www.etoow.com]
http://www.etoow.com/html/2009-04/1240009596.html
  private void UnProtectSection(string sectionName)
Tags:ASP.NET   配置文件   加密   解密
ASP.NET 2.0中配置文件的加密与解密
'http://www.etoow.com/html/2009-04/1240009596.html
1
 
2
信息搜索
  
联系我们关于本站广告服务设为首页 收藏本站友情链接网站地图
Copyright © Etoow.com Inc. All Rights Reserved