2025-03-05 23:12:50 +01:00
|
|
|
|
using System.Configuration;
|
|
|
|
|
|
|
|
|
|
namespace ProgrammList.ConfigManager {
|
2025-03-05 23:36:41 +01:00
|
|
|
|
public class ConfigManager {
|
2025-03-05 23:12:50 +01:00
|
|
|
|
public static string GetSetting(string key) {
|
|
|
|
|
return ConfigurationManager.AppSettings[key];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void SetSetting(string key, string value) {
|
|
|
|
|
Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
|
|
|
|
|
configuration.AppSettings.Settings[key].Value = value;
|
|
|
|
|
configuration.Save(ConfigurationSaveMode.Full, true);
|
|
|
|
|
ConfigurationManager.RefreshSection("appSettings");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|