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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -