Skip to content

Commit

Permalink
§
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiagoSousa81 committed Jan 4, 2025
1 parent 5dbc30d commit c33ea48
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 56 deletions.
1 change: 0 additions & 1 deletion EBS-LAB/frmLogin.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 1 addition & 55 deletions EBS-LAB/frmLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ public frmLogin()
InitializeComponent();
}

private void frmLogin_Load(object sender, EventArgs e)
{

}

private void btnLogin_MouseEnter(object sender, EventArgs e)
{
btnLogin.BackColor = Color.FromArgb(0, 100, 0);
Expand All @@ -49,56 +44,7 @@ private void btnSingUp_MouseLeave(object sender, EventArgs e)
private void btnSingUp_Click(object sender, EventArgs e)
{
Process.Start(new ProcessStartInfo(@"https://web.ebs-systems.epizy.com/singup") { UseShellExecute = true });
}

/* private async void btnLogin_Click(object sender, EventArgs e)
{
string user = txtUser.Text;
string pass = txtPassword.Text;
// URL da API
string url = "https://ebs-web-auth.vercel.app/login";
using (HttpClient client = new HttpClient())
{
var postData = new StringContent(
$"user={user}&pwd={pass}",
Encoding.UTF8,
"application/x-www-form-urlencoded"
);
try
{
// Envia a requisição POST
HttpResponseMessage response = await client.PostAsync(url, postData);
// Lê a resposta da API
string responseContent = await response.Content.ReadAsStringAsync();
// Se a resposta for de sucesso, fazer algo (exibir a resposta ou redirecionar)
if (response.IsSuccessStatusCode)
{
// Aqui, você pode verificar o status da resposta JSON
if (responseContent.Contains("success"))
{
MessageBox.Show("Login bem-sucedido!");
}
else
{
MessageBox.Show("Erro: " + responseContent);
}
}
else
{
MessageBox.Show("Erro ao conectar com a API");
}
}
catch (Exception ex)
{
MessageBox.Show("Erro: " + ex.Message);
}
}
}*/
}

private async void btnLogin_Click(object sender, EventArgs e)
{
Expand Down

0 comments on commit c33ea48

Please sign in to comment.