Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
public class Estado
{
public int id { get; set; }
public string nome { get; set; }
public string uf { get; set; }
}
public class City
{
public int id { get; set; }
public string nome { get; set; }
public bool ativo { get; set; }
public double latitude { get; set; }
public double longitude { get; set; }
public Estado estado { get; set; }
public string bandeira { get; set; }
public string brasao { get; set; }
public string foto_apresentacao { get; set; }
public string data_fundacao { get; set; }
public string apresentacao { get; set; }
public string apresentacao_ingles { get; set; }
public void GetCities()
{
try
{
WebClient client = new WebClient();
client.DownloadStringCompleted += client_DownloadStringCompleted;
client.DownloadStringAsync(new Uri("http://xxxx.yyy.zz"));
}
catch (Exception)
{
}
}
void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
var toor = JsonConvert.DeserializeObject<IList<City>>(e.Result);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.