rt  写个类 求教

解决方案 »

  1.   

    C# 读写 Web.config 的类
      

  2.   

    XmlDocument xmldocument=new XmlDocument(); 
    xmldocument.Load(fileinfo.FullName); 
        foreach(XmlNode node in xmldocument.SelectSingleNode("appSettings").ChildNodes) 
        {  
        if (node.Name == "add") 
        {  
          if (node.Attributes.GetNamedItem("key").Value == "connString") 
          { 
          node.Attributes.GetNamedItem("value").Value= String.Format("Persist Security Info=False;Data Source={0};Initial Catalog={1};User ID={2};Password={3};Packet Size=4096;Pooling=true;Max Pool Size=100;Min Pool Size=1","","","","'); 
          }  
        }  
        } 
      
    http://topic.csdn.net/u/20091027/09/83a368f5-7086-4186-8652-d08ffe46ba29.html