

















string fs = @"C:\web.config";
XmlDocument xmlDoc=new XmlDocument();
xmlDoc.Load(fs);
XmlNodeList nodeList=xmlDoc.SelectSingleNode("configuration").SelectSingleNode("CloverConfiguration").ChildNodes;
foreach(XmlNode xn in nodeList)
{
try
{
XmlElement xe=(XmlElement)xn;
if(xe.GetAttribute("key")=="Clover.DataAccess.ConnectionString")
{
xe.SetAttribute("value","server=server1;User ID=sa;Password=00000000;database=Clover;Connection Reset=FALSE");
break;
}
}
catch{}
}
xmlDoc.Save(fs);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。