I got this error msg
Cannot find file <?xml version="1.0" encoding="UTF-8"?>
Below is the code. How to resolve this issue? Appreciate your help.
rivate void button1_Click(object sender, RoutedEventArgs e)
{
string sPath = "http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false";
WebClient wc = new WebClient();
wc.DownloadStringAsync(new Uri(sPath));
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
}
void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
XDocument xdoc = XDocument.Load(e.Result);
XElement locationElement = xdoc.Element("GeocodeResponse").Element("result").Element("geometry").Element("location");
double latitude = (double)locationElement.Element("lat");
double longitude = (double)locationElement.Element("lng");
txtBlkLatLon.Text = latitude.ToString() + "," + longitude.ToString();
}