亚里士多德
鱼对水说你看不到我的眼泪,因为我在水里.水说我能感觉到你的眼泪,因为你在我心里.
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);
posted on 2005-06-14 22:23  Austin leng  阅读(305)  评论(0编辑  收藏  举报