阅读124 返回首页    go 阿里云 go 技术社区[云栖]


加密配置节

 protected void Button1_Click(object sender, EventArgs e) { Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); ConfigurationSection appSettings = config.GetSection("connectionStrings"); if (appSettings.SectionInformation.IsProtected) { appSettings.SectionInformation.UnprotectSection(); lblInfo.Text = "配置节已解密!"; } else { appSettings.SectionInformation.ProtectSection( "DataProtectionConfigurationProvider"); Button1.Text = "解密"; lblInfo.Text = "已加密配置节!"; } config.Save(); } 

最后更新:2017-04-02 04:01:42

  上一篇:go semget, semop and semctl函数小记
  下一篇:go 2010年最新令人无语语录