このエラーメッセージが表示されました
ファイルが見つかりません<?xml version = "1.0" encoding = "UTF-8"?>
以下はコードです。この問題を解決するにはどうすればよいですか?あなたの助けに感謝。
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(オブジェクト送信者、DownloadStringCompletedEventArgs e)
{{
XDocument xdoc = XDocument.Load(e.Result);
XElement locationElement = xdoc.Element( "GeocodeResponse")。Element( "result")。Element( "geometry")。Element( "location");
二重緯度=(double)locationElement.Element( "lat");
二重経度=(double)locationElement.Element( "lng");
txtBlkLatLon.Text = Latitude.ToString()+ "、" +longitude.ToString();
}