namespace Example { public class AddressComponent { [JsonProperty("long_name")] public string LongName { get; set; } [JsonProperty("short_name")] public string ShortName { get; set; } [JsonProperty("types")] public string[] Types { get; set; } } public class Northeast { [JsonProperty("lat")] public double Lat { get; set; } [JsonProperty("lng")] public double Lng { get; set; } } public class Southwest { [JsonProperty("lat")] public double Lat { get; set; } [JsonProperty("lng")] public double Lng { get; set; } } public class Bounds { [JsonProperty("northeast")] public Northeast Northeast { get; set; } [JsonProperty("southwest")] public Southwest Southwest { get; set; } } public class Location { [JsonProperty("lat")] public double Lat { get; set; } [JsonProperty("lng")] public double Lng { get; set; } } public class Northeast2 { [JsonProperty("lat")] public double Lat { get; set; } [JsonProperty("lng")] public double Lng { get; set; } } public class Southwest2 { [JsonProperty("lat")] public double Lat { get; set; } [JsonProperty("lng")] public double Lng { get; set; } } public class Viewport { [JsonProperty("northeast")] public Northeast2 Northeast { get; set; } [JsonProperty("southwest")] public Southwest2 Southwest { get; set; } } public class Geometry { [JsonProperty("bounds")] public Bounds Bounds { get; set; } [JsonProperty("location")] public Location Location { get; set; } [JsonProperty("location_type")] public string LocationType { get; set; } [JsonProperty("viewport")] public Viewport Viewport { get; set; } } public class Result { [JsonProperty("address_components")] public AddressComponent[] AddressComponents { get; set; } [JsonProperty("formatted_address")] public string FormattedAddress { get; set; } [JsonProperty("geometry")] public Geometry Geometry { get; set; } [JsonProperty("partial_match")] public bool PartialMatch { get; set; } [JsonProperty("types")] public string[] Types { get; set; } } public class GoogleResponse { [JsonProperty("results")] public Result[] Results { get; set; } [JsonProperty("status")] public string Status { get; set; } } }
GoogleResponse jsonData = JsonConvert.DeserializeObject<GoogleResponse>(result);
Textbox1.text = jsonData.Results.AddressComponent.LongName.tostring();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)