Nombre de tentatives restantes

Bonjour Forum

Bonjour tout le monde

SVP chers membres si vous pouvez m'aider a completer ce code ..

J'aime bien avoir si vous pouvez m'aider .. ajouter le nombre de tentatives restantes

Apres la premiere fausse tentative alors un MsgBox ou une troisieme UserForm qui m'indique le nombre restante

Avec ce code .. apres trois fausses tentatives on quitte l'application sans indication de nombre restant :

Option Explicit
Dim m_lNofTries As Long
Dim SERIAL As String
Dim X As New ABIDINE.XP10

Private Sub CommandButton1_Click()
SERIAL = TextBox1.Text + TextBox2.Text + TextBox3.Text 
Me.Caption = SERIAL
If UCase(SERIAL) = UCase(X.MD5(Trim$(TextBox4.Text))) Then
MsgBox "BienVenue dans notre programme,", vbOKOnly
UserForm2.Show
Else
m_lNofTries = m_lNofTries + 1
If m_lNofTries = 3 Then
MsgBox "3 fausses tentatives ..AU REVOIR", vbCritical
Unload Me
End If
End If
End Sub

Merci beaucoup d'avance pour l'aide

Tres cordialement

ABIDINE

bonjour

Option Explicit
Dim m_lNofTries As Long
Dim SERIAL As String
Dim X As New ABIDINE.XP10

Private Sub CommandButton1_Click()
SERIAL = TextBox1.Text + TextBox2.Text + TextBox3.Text 
Me.Caption = SERIAL
If UCase(SERIAL) = UCase(X.MD5(Trim$(TextBox4.Text))) Then
MsgBox "BienVenue dans notre programme,", vbOKOnly
UserForm2.Show
Else
m_lNofTries = m_lNofTries + 1

If m_lNofTries <3 Then
msgbox "mot de passe erroné,  reste(nt)  " & 3- m_lNofTries & " essai(s)"
elseIf m_lNofTries = 3 Then
MsgBox "3 fausses tentatives ..AU REVOIR", vbCritical
Unload Me
End If
End If
End Sub
 

Bonjour h2so4

Merci beaucoup pour votre impeccable code

Tres gentil de votre part

C'est exactement ce que je veux avoir

C'est formidablement resolu

Une autre fois merci

Cordialement

ABIDINE

Rechercher des sujets similaires à "nombre tentatives restantes"