You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
680 B

using System.Configuration;
namespace SparkClient.Model.Helper;
public class ConfigurationHelper
{
static System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
public static string ReadConfigValue(string key)
{
string name = config.AppSettings.Settings[key].Value;
return name;
}
public static void SetConfigValue(string key, string value)
{
config.AppSettings.Settings[key].Value = value;
config.Save(ConfigurationSaveMode.Modified);
System.Configuration.ConfigurationManager.RefreshSection("appSettings");
}
}