コード例 #1
0
        private void btnOnclic(object sender, EventArgs args)
        {
            string cep = Cep.Text.Trim();

            if (cepValido(cep))
            {
                try
                {
                    if (cep != null)
                    {
                        Endereco end = ViaCepService.BuscaEnderecoViacep(cep);
                        Resultado.Text = "Rua" + end.logradouro;
                    }
                    else
                    {
                        DisplayAlert("ERRO CRITICO", "Cep Não existe -> " + Cep.Text, "ok");
                    }
                }
                catch (Exception e)
                {
                    DisplayAlert("ERRO CRITICO", e.ToString(), "ok");
                }
            }
            else
            {
            }
        }