{
XmlDocument xDoc = new XmlDocument();
xDoc.Load("http://maps.googleapis.com/maps/api/directions/xml?origin=92610&destination=92630&sensor=false");
XmlNodeList xnList = xDoc.SelectNodes("DirectionsResponse/route/leg/distance");
foreach (XmlNode xn in xnList)
{
Response.Write("distance-> "+xn["text"].InnerText);
}
XmlNodeList xnList1 = xDoc.SelectNodes("DirectionsResponse/route/leg/duration");
foreach (XmlNode xn in xnList1)
{
Response.Write("<br>duration-> " + xn["text"].InnerText);
}
}
No comments:
Post a Comment