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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the ihttphandler and ihttphandlerfactory interfaces ?

924


What are the major built-in objects in ASP.NET?

1079


What is difference between datalist and gridview?

1064


How can I open ashx file in mobile?

1134


Contrast OOP and SOA. What are tenets of each ?

2219


Explain the reason why the javascript validation not run on the asp.net button but run successfully on the html button?

1017


What is a session http?

905


Why is string called immutable data type?

1022


How do you implement sql caching in asp.net?

1038


What is active web page?

935


What is difference between mvc and asp.net? : Asp.Net MVC

1173


What is a web api?

1038


How to fetch a data from one table to another table in asp.net ?

1027


i want to implement grid view value in paypal site. so how to create this code in asp.net with C#

1849


Will session work if cookies is disabled?

1001