如何将数据保存到web.config文件?

时间:2011-04-18 12:01:00

标签: asp.net

2 个答案:

答案 0 :(得分:3)

答案 1 :(得分:0)

尝试

System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
config.AppSettings.Settings.Item("Key").Value = TextBox1.Text;
config.Save(ConfigurationSaveMode.Modified);