.net 如何修改config文件

by kevin 25. 十月 2018 11:31 >
string appConfigFile = Assembly.GetEntryAssembly().Location; Configuration appConfig = ConfigurationManager.OpenExeConfiguration(appConfigFile); AppSettingsSection appSettings = (AppSettingsSection)appConfig.GetSection("appSettings"); var config = UploadConfig; appSettings.Settings["KEY"].Value = "VALUE"; appConfig.Save(); ... [更多...]