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

What are strong names?

0 Answers  


what is use of doctype tag in asp.net

1 Answers   TCS, Wipro,


Can we store PROGID information in database and dynamically load the component ?

1 Answers   Digital GlobalSoft, e4e,


What does setting a control's EnableViewState property to false accomplish?

1 Answers  


Which template must you provide, in order to display data in a Repeater control?

1 Answers  


What?s the difference between Response.Write() and Response.Output.Write()?

2 Answers   Siebel, Visual Soft,


What is application Object?

0 Answers   Infogain,


Tell something about state management in asp.net?

3 Answers   Accenture,


Define satellite assemblies.

0 Answers  


What will happen if the server confugration file and the application confugration file have different values for sassion state ASP.NET?

0 Answers   HCL,


Where does Web.Config Info stored? Will this be stored in the registry?

4 Answers   Accenture,


When during the page processing cycle is ViewState available?

1 Answers   Siebel Systems,


Categories