ExeConfigurationFileMap filemap = new ExeConfigurationFileMap();
filemap.ExeConfigFilename = "AupdateConsole.exe.config";
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(filemap, ConfigurationUserLevel.None);
config.AppSettings.Settings["nowVersion"].Value = _nowVersion;
config.AppSettings.Settings["siteCode"].Value = _siteCode;
config.AppSettings.Settings["siteName"].Value = _siteName;
config.AppSettings.Settings["appId"].Value = _appId;
config.AppSettings.Settings["appCode"].Value = _appCode;
config.Save();
return true;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12639172/viewspace-349321/ ,如需转载,请注明出处,否则将追究法律责任。