Encrypt Winform Connectionstrings

Protect or unprotect connectionstrings can be done with the following code sample:

' Connection string encryption
Dim config As Configuration = ConfigurationManager.OpenExeConfiguration
                    (ConfigurationUserLevel.None)
config.ConnectionStrings.SectionInformation.ProtectSection(Nothing)
' We must save the changes to the configuration file
config.Save(ConfigurationSaveMode.Full, True)
Advertisements

%d bloggers like this: