XML格式的字符串:

<xml><return_code><![CDATA[{0}]]></return_code><return_msg><![CDATA[{1}]]></return_msg></xml>

就像上面例子格式的字符串,如果参数0中放入数据SUCCESS,如何取得SUCCESS节点数据

这个节点一般都会存取敏感数据
public static string Deserialize(string xml)
{
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);
            string xpathChiefComplaint = "/xml/return_code";
            XmlNode xnChiefComplaint = doc.SelectSingleNode(xpathChiefComplaint);
            string nodeValue = xnChiefComplaint.InnerText;
            return nodeValue;
}

如上代码方法就能取到节点中的SUCCESS数据

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案