保存web.config文件(转载)
string appSetting = txtAppSetting.Text;//appSetting子节点值
string connectionString = txtConnectionString.Text;//连接字符串
string key = txtKey.Text;//appSetting子节点Key
string connectionName = txtConnectionName.Text;//连接Name
ConfigurationOperator op = new ConfigurationOperator();
op.SetAppSetting(key, appSetting);
op.SetConnectionString(connectionName, connectionString);
op.Save();
本篇文章来源于:开发学院 http://edu.codepub.com