View Code
1 public string GetXmlNodeValue(string strXml,string strNodeName,string strValueName)
2 {powered by 25175.net
3 try
4 {
5 System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
6 xmlDoc.LoadXml(strXml);
7 System.Xml.XmlNode xNode = xmlDoc.SelectSingleNode("//" + strNodeName + "");
8 string strValue = xNode.Attributes[strValueName].Value;
9 return strValue;
10 }
11 catch (Exception ex)
12 {
13 return ex.Message;
14 }
15
16 }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案