Created
February 22, 2014 18:38
-
-
Save guilhermecarvalhocarneiro/9159757 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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