//把String 转成XML
string resultString = "<querycategory><name>GiftShops</name><score>0.36622</score><name>Wine</name><score>0.14643</score><name>CoffeeampTea</name><score>0.09771</score></querycategory>";
        XmlDocument doc = new XmlDocument();
        doc.LoadXml(resultString);
        XmlElement root = doc.DocumentElement;
        XmlNodeList list = doc.DocumentElement.ChildNodes;
        string j = ((XmlElement)list[0]).InnerText;
        string k = ((XmlElement)list[1]).InnerText;
        Response.Write(j);
        Response.Write(k);

//将XML转成String
string path=Server.MapPath(null)+@"\my_phone.xml";
   XmlDocument table=new XmlDocument();
   table.Load(path);
   XmlNode root=table.DocumentElement;
   StringBuilder str=new StringBuilder();
   str.Append(root.OuterXml);

相关文章:

  • 2022-02-26
  • 2021-08-07
  • 2022-02-12
  • 2022-12-23
  • 2021-11-30
  • 2021-06-18
  • 2021-06-26
  • 2021-07-22
猜你喜欢
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
  • 2022-01-23
  • 2021-12-26
  • 2022-12-23
相关资源
相似解决方案