Login form

Contenu du snippet

Public Class Connexion
    Dim Hack As Integer
    Private Sub Connexion_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        label3.select()
    End Sub

    Private Sub User_Click(sender As Object, e As EventArgs) Handles User.Click
        User.Text = ""
    End Sub

    Private Sub PasswordD_Click(sender As Object, e As EventArgs) Handles PasswordD.Click
        PasswordD.PasswordChar = "*"
        PasswordD.Text = ""
    End Sub

    Private Sub BtnOK_Click(sender As Object, e As EventArgs) Handles BtnOK.Click
        If UCase(User.Text) = "SOLDAT" And UCase(PasswordD.Text) = "FARDC" Then
            MsgBox("Voue êtes actuellement connecter !", MsgBoxStyle.Information, "Connexion")
            Me.Hide()
            MenuG.Show()
        Else
            If User.Text = "soldat" And PasswordD.Text = "" Then
                MsgBox("Inserer le mot de passe !", MsgBoxStyle.Information, "Verification")
            Else
                If User.Text = "" And PasswordD.Text = "fardc" Then
                    MsgBox("Inserer le nom d'utilisateur !", MsgBoxStyle.Information, "Verification")
                Else
                    If User.Text = "" And PasswordD.Text = "" Then
                        MsgBox("Inserer le nom d'utilisateur et/ou le mode passe !", MsgBoxStyle.Exclamation, "Verification")
                    Else
                        MsgBox("L'identifiant invalide !", MsgBoxStyle.Critical, "Erreur")
                        User.Clear()
                        PasswordD.Clear()
                        User.Focus()
                        If Hack = 3 Then
                            Beep()
                            MsgBox("Reesayer plutard!", MsgBoxStyle.Critical, "Fermeture")
                            Application.Exit()
                        End If
                    End If
                End If
            End If
        End If
    End Sub

    Private Sub BtnNO_Click(sender As Object, e As EventArgs) Handles BtnNO.Click
        If MsgBox("Vous ne voulez plus continuer la consultation ? ", MsgBoxStyle.Information + vbYesNo, "FERMETURE") = vbYes Then
            Application.Exit()
        End If
    End Sub
End Class

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.