Windows Phone get value from url with xml code



I am trying to get live currency rate from this url: http://ift.tt/1pXXFk7


This is what I tried:



public void getRate(string howmuch, string from, string to)
{
int hmuch = int.Parse(howmuch);
string url = "http://ift.tt/1pXXFk7";
var xml = XDocument.Load(url);
var result = xml.Descendants("double");
btn.Content = result;
}


I get an error from XDocument.Load that I need to pass URI from filesystem, not URL from web. I didn't found correct way on the web to do this in windows phone, only with full C#. How to properly get that value between double tags?


No comments:

Post a Comment