private void changeConfig()
{
XmlDocument xDoc = new XMLDocument();
string strName = AppDomain.CurrentDomain.BaseDirectory.ToString()+"Web.config";
xDoc.Load(strName);
XMLNodeList xnl = xDoc.GetElementsByTagName("add");
// foreach( XMLNode xn in xnl)
// {
// Response.Write(xn.Attributes["v"].Value.ToString());
// }
for(int i=0; i<xnl.Count; i++)
{
xnl[i].Attributes["key"].Value = "Sql1";
xnl[i].Attributes["value"].Value = "Server=.;Database=test;uid=sa;pwd=123";
}
xDoc.Save(strName);
}