Skip to content

Commit

Permalink
§§
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiagoSousa81 authored Jan 3, 2025
1 parent 41da794 commit fe308f4
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions EBS-LAB/frmLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,24 +117,27 @@ private async void btnLogin_Click(object sender, EventArgs e)

// Lê a resposta da API
string responseContent = await response.Content.ReadAsStringAsync();

// Se a resposta for de sucesso
if (response.IsSuccessStatusCode)


// Verifica se a resposta contém "success"
if (responseContent.Contains("success"))
{
// Verifica se a resposta contém "success"
if (responseContent.Contains("success"))
{
MessageBox.Show("Login bem-sucedido!");
}
else
{
MessageBox.Show("Erro: " + responseContent);
}
MessageBox.Show("Login bem-sucedido!");
}
else
{
MessageBox.Show("Erro ao conectar com a API");
MessageBox.Show("Erro: " + responseContent);
}


/*// Se a resposta for de sucesso
if (response.IsSuccessStatusCode)
{
}
else
{
MessageBox.Show("Erro ao conectar com a API");
}*/
}
catch (Exception ex)
{
Expand Down

0 comments on commit fe308f4

Please sign in to comment.