private string GetLocalByPostalCode(string PostalCode7) { HttpWebRequest webRequest = WebRequest.Create(@"http://codigospostais.appspot.com/cp7?codigo=" + PostalCode7) as HttpWebRequest; webRequest.Timeout = 20000; webRequest.Method = "GET"; WebResponse response = webRequest.GetResponse(); using (var stream = response.GetResponseStream()) { var r = new StreamReader(stream); var resposta = r.ReadToEnd(); CityResolver codPostal = new CityResolver(resposta); return(codPostal.Localidade); } }
public async void FillCityPicker(string zipCode) { Cities.Clear(); Cities = await CityResolver.GetCityFmZipCode(zipCode); }