c# - Get XML with single Data -
this site http://geoiptool.com/data.php report data in xml
<markers> <marker lat="xxx" lng="xxx" city="xxx" country="xxx" host="xxx" ip="xx" code="xx"/> </markers>
is possible lat, lng, city , country? tried this:
xmldocument doc = new xmldocument(); doc.load("http://geoiptool.com/data.php"); string xmlcontents = doc.innerxml;
but return xml data
once node looking (marker), can grab attributes it. note idea check if attribute null before accessing property it. example of getting lat attribute:
xmldocument doc = new xmldocument(); doc.load("http://geoiptool.com/data.php"); var marker = doc.selectsinglenode("//markers/marker"); string lat = marker.attributes["lat"].value;
Comments
Post a Comment