je vois pas trop comment mettre en place les solutions
genre le code suivant
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
protected override void OnStartup(StartupEventArgs e)
{
// Lots of other important stuff here...
EncryptConfigSection("userSettings/Witty.Properties.Settings");
base.OnStartup(e);
}
private void EncryptConfigSection(string sectionKey)
{
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConfigurationSection section = config.GetSection(sectionKey);
if (section != null)
{
if (!section.SectionInformation.IsProtected)
{
if (!section.ElementInformation.IsLocked)
{
section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
section.SectionInformation.ForceSave = true;
config.Save(ConfigurationSaveMode.Full);
}
}
} |
}qui crypte le fichier .config, je le met où ?
et puis si dans mon code vb.net y a le code qui obtient le mot de passe, ce code peut etre copié dans un autre projet pour décrypter le .config, non ?
Partager