0
我正在嘗試使用離線路由的Windows Phone應用程序。我發現通過使用Bing API是可能的。 我已經註冊並獲得了密鑰,但是我找不到,我該如何使用密鑰。Windows Phone離線路由
我使用下面的代碼:
private async void Button_Click(object sender, RoutedEventArgs e)
{
RouteQuery query = new RouteQuery();
List<GeoCoordinate> wayPoints = new List<GeoCoordinate>();
wayPoints.Add(new GeoCoordinate(47.23449, -121.172447));
wayPoints.Add(new GeoCoordinate(47.062638, -120.691795));
query.Waypoints = wayPoints;
query.QueryCompleted += geoQ_QueryCompleted;
query.QueryAsync();
}
private void geoQ_QueryCompleted(object sender, QueryCompletedEventArgs<Route> e)
{
try
{
Route myRoute = e.Result;
MessageBox.Show("Completed");
}
catch (TargetInvocationException)
{
/// Unauthorized access exception 0x8004231C
Thread.Sleep(1000); // waiting for completing the query
geoQ_QueryCompleted(sender, e);
}
}
但我正在逐漸未經授權的訪問異常0x8004231C。 我想問你,我該如何解決?
的可能重複的[Bing地圖GetRoute給出 '0x8004231C' 錯誤](http://stackoverflow.com/questions/23218392/bing-maps-getroute-給-0x8004231c錯誤) –