using System.IO;
using System.Xml;
/// <summary>
/// 装载Response
/// </summary>
/// <param name="sResponse">返回的信息</param>
public static string LoadXmlResponse(string sResponse, string sNodeKey)
{
string sNodeValue = string.Empty;
if (!(StringIs.isEmpty(sResponse)))
{
XmlDataDocument mXmlDataDocument = new XmlDataDocument();
mXmlDataDocument.LoadXml(sResponse);
XmlNode pXmlNode = mXmlDataDocument.SelectSingleNode("property");
if (null != pXmlNode)
{
while (0 < pXmlNode.ChildNodes.Count)
{
XmlNode cXmlNode = pXmlNode.FirstChild;
if (cXmlNode.LocalName.Equals(sNodeKey))
{
sNodeValue = cXmlNode.InnerText;
break;
}
else
{
pXmlNode.RemoveChild(cXmlNode);
}
}
}
}
return sNodeValue;
}
浙公网安备 33010602011771号