string appPath = System.IO.Path.GetDirectoryName(Reflection.Assembly.GetExecutingAssembly().Location); string configFile = System.IO.Path.Combine(appPath, "App.config");ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap(); configFileMap.ExeConfigFilename = configFile; System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);config.AppSettings.Settings["YourThing"].Value = "New Value"; config.Save();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)