Skip to content

Instantly share code, notes, and snippets.

@guilhermecarvalhocarneiro
Created February 22, 2014 18:38
Show Gist options
  • Save guilhermecarvalhocarneiro/9159757 to your computer and use it in GitHub Desktop.
Save guilhermecarvalhocarneiro/9159757 to your computer and use it in GitHub Desktop.
{
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