1
A
回答
4
2
試試這個
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();
}
}
相關問題
- 1. 如何從代碼隱藏中訪問web.config的httpRuntime部分?
- 2. 在EF4.1代碼中,如何覆蓋Web.config中的ConnectionString名稱
- 3. 如何從web.config文件中檢索connectionString?
- 4. 如何從代碼隱藏
- 5. 解密的SqlDataSource從代碼隱藏C#
- 6. 如何在Sensu配置中隱藏/加密密碼?
- 7. 如何在QLineEdit中隱藏密碼
- 8. 僅加密web.config中的密碼ASP.NET
- 9. 加密web.config中的密碼字符串
- 10. 如何從代碼文檔中隱藏查看源代碼?
- 11. 在textField中隱藏密碼「•••••••」
- 12. 如何隱藏xcode中的源代碼?
- 13. 從代碼隱藏
- 14. 從代碼隱藏
- 15. 從代碼隱藏
- 16. 從代碼隱藏
- 17. 加密Web.Config中
- 18. 進入後隱藏輸入文本,輸入後隱藏密碼
- 19. rmarkdown中的隱藏代碼
- 20. 如何在Swift中隱藏此代碼
- 21. InvalidCastException的代碼隱藏從
- 22. Datagrid中的工具提示,從代碼隱藏中添加
- 23. 在實體框架中加密ConnectionString(第一個代碼)
- 24. ASP.NET如何從代碼隱藏
- 25. 如何調用從代碼隱藏
- 26. 如何從java代碼隱藏linearlayout?
- 27. 如何更新從代碼隱藏
- 28. YouTubePlayer - 如何隱藏/加密API密鑰?
- 29. 如何在代碼隱藏中在ImageButton中加載圖像?
- 30. 添加代碼隱藏從C#Asp.net