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 |
what does Page.IsValid in asp.net
6 Answers Infosys, Net Solution,
When does a session actually start?
What is the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc
How to register exception filter globally?
What is preprocessor in .net?
What is WCF? Pls Explain clearly with exmple.
When Cookies are expired in ASP.NET?
0 Answers Sans Pareil IT Services,
What is a WebService and what is the underlying protocol used in it? Namespace?
What is boxing and unboxing in asp.net?
Usage of web.config?
What is the relationship(in oops) between codebehind and inline code(.aspx to .aspx.cs)??? explain
Describe SOA and the tenets of it?
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)