Torna al Thread
Configuration WebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection sezioneProt1 = WebConfig.GetSection("system.net/mailSettings/smtp/network");
if (!sezioneProt1.SectionInformation.IsProtected)
{
sezioneProt1.SectionInformation.ProtectSection(protectionProvider);
WebConfig.Save();
Label2.Text = "MailSettings criptato con " + protectionProvider;
}
else
Label2.Text = "MailSettings già criptato";