which method marks a config file section for encryption?
Answer / guest
protected void Page_Load(object sender, EventArgs e) {
Configuration config;
ConfigurationSection configSection;
config = WebConfigurationManager.OpenWebConfiguration
(Request.ApplicationPath);
configSection = config.GetSection("connectionStrings");
if (configSection != null) {
if (!(configSection.SectionInformation.IsLocked)) {
configSection.SectionInformation.ProtectSection("
DataProtectionConfigurationProvider");
config.Save();
} } }
To unprotect :
Public Sub Page_Load()
Dim config As Configuration
Dim configSection As ConfigurationSection
config = WebConfigurationManager.OpenWebConfiguration
(Request.ApplicationPath)
configSection = config.GetSection("connectionStrings")
If Not (configSection Is Nothing) Then
If Not (configSection.SectionInformation.IsLocked) Then
configSection.SectionInformation.UnprotectSection()
config.Save()
End If
End If
End Sub
| Is This Answer Correct ? | 2 Yes | 0 No |
About Global .asax ?
What namespaces are imported by default in ASMX files?
If cookies is disabled in client browser will session work ?
How do you make your site SSL enabled ?
COM+ Used ________________ Isolation Level
How to merge 2 tables fields in DataTable in asp.net
Fetch one page value to another page without using state-managment ?
What are PDBs? Where must they be located for debugging to work?
What is the difference between WindowsDefaultLocation and WindowsDefaultBounds?
Different type of validation controls in asp.net ?
1 Answers CTS, Keane India Ltd,
What?s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
Rate yourself in .net and sql database?
1 Answers BrickRed, Infosys, Satyam, SP Software,
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)