閱讀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年最新令人無語語錄