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 |
In a Code-Behind class generally which type of code is found ?
What are cookies in asp.net?
What are the modes of updation in an updatepanel?
What is the usie of activex control in .net?
6. Tell us about a time when you failed to meet a deadline. What were the repercussions?
0 Answers AlKhaleej, Swatz Oils,
What are the types of session in asp.net?
What are the different ways you would consider sending data across pages in ASP (i.e between 1.asp to 2.asp)?
What is http post and http get?
What is a SESSION and APPLICATION object?
What is asp.net globalization?
I create small website, i want accept all the browser this website? what will do?
Disable Session State at the Application Level