this is my code ...
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
AppSettingsSection configSection = config.AppSettings;
try
{
if (configSection != null)
{
if (configSection.IsReadOnly() == false && configSection.SectionInformation.IsLocked == false)
{
configSection.Settings["DailyFilName"].Value = "NewValue";
config.Save();
}
}
}
catch (ConfigurationException ex)
{
MessageBox.Show(ex.Message, "Configuration Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
But it does not update my configuration file :(
source
share