1. 程式人生 > >XML獲取節點信息值

XML獲取節點信息值

inner urn 節點 gbk CA bsp load eno document

XmlDocument doc = new XmlDocument();
doc.LoadXml(sreturn);

XmlNode xNode = doc.SelectSingleNode("LisCallResponse/ResponseHead/Success");//取is_success節點的值
string is_success = xNode.InnerText;

XML格式信息如下:

<?xml version="1.0" encoding="GBK"?>

<LisCallResponse>

<ResponseHead>

<Success>Y</Success>

<Msg>保存成功</Msg>

</ResponseHead>

<ResponseBody>

</ResponseBody>

</LisCallResponse>

XML獲取節點信息值