//Runthis method in page load
public void EncryptConnString()
{
Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection section = config.GetSection("connectionStrings");
if (section.SectionInformation.IsProtected)
{
//To Encript
section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
config.Save();
//To Decript
//section.SectionInformation.UnprotectSection();
//config.Save();
}
}
Monday, December 21, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment