title: Parse JSON code from Bing Map API in C#
body: <p>I use Bing Map REST API, because i want to find out the geolocation from a secific location. The Url works great, but due to the fact, i use JSON code the first time, i dont really know how i get the output i want.</p>
  
  <p>I tried the following: </p>
  
  <pre><code>string URL = "http://dev.virtualearth.net/REST/v1/Locations?countryRegion=&amp;adminDistrict=&amp;locality=Wien&amp;postalCode=&amp;addressLine=&amp;userLocation=&amp;userIp=&amp;usermapView=&amp;includeNeighborhood=&amp;maxResults=&amp;key=MY_KEY";
  WebClient client = new WebClient();
  client.OpenReadAsync(new Uri(URL, UriKind.Absolute));
  client.OpenReadCompleted += new OpenReadCompletedEventHandler(client_OpenReadCompleted);
  
  private void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
  {
      DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(Point));
      Point data = serializer.ReadObject(e.Result) as Point;
  }
  
  [DataContract]
  public class Point
  {
      /// &lt;summary&gt;
      /// Latitude,Longitude
      /// &lt;/summary&gt;
      [DataMember(Name = "coordinates")]
      public double[] Coordinates { get; set; }
  }
  </code></pre>
  
  <p>When I type the link in the browser, this is my response:</p>
  
  <blockquote>
    <p>{"authenticationResultCode":"ValidCredentials","brandLogoUri":"http://dev.virtualearth.net/Branding/logo_powered_by.png","copyright":"Copyright Â© 2013 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":1,"resources":[{"__type":"Location:http://schemas.microsoft.com/search/local/ws/rest/v1","bbox":[47.253395080566406,-123.16571807861328,47.946159362792969,-121.50344085693359],"name":"Seattle, WA","point":{"type":"Point","coordinates":[47.603561401367188,-122.32943725585938]},"address":{"adminDistrict":"WA","adminDistrict2":"King Co.","countryRegion":"United States","formattedAddress":"Seattle, WA","locality":"Seattle"},"confidence":"High","entityType":"PopulatedPlace","geocodePoints":[{"type":"Point","coordinates":[47.603561401367188,-122.32943725585938],"calculationMethod":"Rooftop","usageTypes":["Display"]}],"matchCodes":["Good"]}]}],"statusCode":200,"statusDescription":"OK","traceId":"08bee37ecb714d7cb7e2783eb8f873a4|LTSM000177|02.00.183.2300|LTSIPEVM000039"}</p>
  </blockquote>
  
  <p>My Question now is: is this the correct way to do it? And how do i get the data?</p>
  
  <p>I hope you can help me, I already spent a lot of time with this problem.</p>
  
  <p>-----EDIT-----</p>
  
  <p>Now i use JSON.net, but i dont know, how to parse the data i get from the Website to a string variable.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>var json = new WebClient().DownloadString("url");
  </code></pre>
  
  <p>but this dont work, because i am developing on Windows Phone.</p>
  
  <blockquote>
    <p>System.Net.WebClient does not contain a definition for "DownloadString" ...</p>
  </blockquote>
  
  <p>Anyone can help me to get this working for Windows Phone Apps.</p>