1 Configuration windowsConfig = ConfigurationManager.OpenExeConfiguration(Path.Combine(Application.StartupPath, "WindowsFormsHost.exe"));
2
3 windowsConfig.AppSettings.Settings["ConnectionString"].Value = desCheck.Checked ? DESEncrypt.Encrypt(connText.Text) : connText.Text ;
4 windowsConfig.AppSettings.Settings["ConStringEncrypt"].Value = desCheck.Checked.ToString();
5
6 windowsConfig.Save();
7
8 Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
9
10 config.AppSettings.Settings["ConnectionString"].Value = desCheck.Checked ? DESEncrypt.Encrypt(connText.Text) : connText.Text;
11 config.AppSettings.Settings["ConStringEncrypt"].Value = desCheck.Checked.ToString();
12
13 config.Save();
14
2
3 windowsConfig.AppSettings.Settings["ConnectionString"].Value = desCheck.Checked ? DESEncrypt.Encrypt(connText.Text) : connText.Text ;
4 windowsConfig.AppSettings.Settings["ConStringEncrypt"].Value = desCheck.Checked.ToString();
5
6 windowsConfig.Save();
7
8 Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
9
10 config.AppSettings.Settings["ConnectionString"].Value = desCheck.Checked ? DESEncrypt.Encrypt(connText.Text) : connText.Text;
11 config.AppSettings.Settings["ConStringEncrypt"].Value = desCheck.Checked.ToString();
12
13 config.Save();
14