I am developing a EPOS System in C#.NET. In My Project, i have to implement a scenario:
- User will enter Zip Code/ Postal Code in a Text box.
- Application using google places API will return City, Street and Town separately in 3 Tex box respectively. Please any one help me how to implement this scenario in C#.net.
i already created Google Project on https://console.cloud.google.com/apis/credentials/key and generate Google Place API Key for my project.
I Have searched a lot on google but all example are implemented in asp.net, but i need in C# Net. Anyone Help me. Thanks in Advance.
I have implemented Some how but i don't know how to read it
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web.Script.Serialization;
using Newtonsoft.Json;
namespace apidemo
{
class Program
{
String response, result;
const String apiKey= "My APi kEy";
static void Main(string[] args)
{
getdata("B11 4RA");
Console.ReadLine();
}
static async public void getdata(String code)
{
try
{
using (var client = new HttpClient())
{
var response = await client.GetStringAsync(String.Format("https://maps.googleapis.com/maps/api/place/autocomplete/json?key="+ apiKey + "&input=" +code));
Console.WriteLine(response);
}
}
catch (Exception ex) {
Console.Write(ex.ToString());
}
}
}
}