Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


which method marks a config file section for encryption?



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

Post New Answer

More ASP.NET Interview Questions

About Global .asax ?

6 Answers   Satyam,


What namespaces are imported by default in ASMX files?

2 Answers  


If cookies is disabled in client browser will session work ?

7 Answers   Satyam,


How do you make your site SSL enabled ?

3 Answers   Satyam,


COM+ Used ________________ Isolation Level

0 Answers   CTS,


How to merge 2 tables fields in DataTable in asp.net

6 Answers   Wipro,


Fetch one page value to another page without using state-managment ?

0 Answers   HCL,


What are PDBs? Where must they be located for debugging to work?

4 Answers  


What is the difference between WindowsDefaultLocation and WindowsDefaultBounds?

0 Answers   BirlaSoft,


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"?

5 Answers   SLC Ltd,


Rate yourself in .net and sql database?

1 Answers   BrickRed, Infosys, Satyam, SP Software,


Categories