1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| p = -1
If TextBox1.Text = "" Or TextBox2.Text = "" Then
MsgBox("Entrer votre Login et mot de passe!!", MsgBoxStyle.Exclamation, "Attention")
Else
opensql("select Nom,LOGIN,pass,Type_compte from utilisateur ", "utilisateur")
For i As Integer = 0 To dt.Rows.Count - 1
If TextBox1.Text = dt.Rows.Item(i)("Login").ToString And TextBox2.Text = dt.Rows.Item(i)("pass").ToString Then
p = i
Exit For
End If
Next
If p = -1 Then
MsgBox("Login ou /et mot de passe incorrect!!", MsgBoxStyle.Exclamation, "Connect")
TextBox1.Clear()
TextBox2.Clear()
Else
MsgBox("bienvenue Mr/Melle " & dt.Rows.Item(p)("Nom") & "", MsgBoxStyle.Information, " Bien connecté")
Hide()
Menu_general.Show()
End If
End If
ds.Clear() |
Partager