I am encrypting my connection string in the web.config file with this code in my aspx download.
protected void Page_Load(object sender, EventArgs e) { Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); ConnectionStringsSection connSection = (ConnectionStringsSection)config.GetSection("connectionStrings"); connSection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider"); config.Save(); }
I am new to C # and now I need to decrypt. Any idea how?
I could only decrypt one line using the following code.
protected void Page_Load(object sender, EventArgs e) { Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); ConnectionStringsSection connSection = (ConnectionStringsSection)config.GetSection("connectionStrings");
Thanks.
source share