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 }