viernes, 24 de julio de 2015

CREAR UN USER NAME Y PASWORD

CREAR UN USER NAME Y PASWORD
Public Class Form1
    'DEFINICION DE VARIABLES DEL EJERCICIO'}
    Dim cce As Integer
    Dim error1 As String

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        cce = 0
        txtuser.Focus()

    End Sub

    Private Sub cmbvalidar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbvalidar.Click
        If ((txtuser.Text = "4C1" Or txtuser.Text = "4c1") And (txtpasword.Text = "12345" Or txtpasword.Text = "09856")) Then

            MsgBox("usuario identificado", MsgBoxStyle.OkOnly)
            Me.Hide()
            Form2.Show()
        Else
            cce = cce + 1
            MsgBox("USER y/o paasword incorrecto", MsgBoxStyle.Exclamation)
            If cce < 3 Then
                error1 = MsgBox("usted se ha equivocado" & cce & "veces", MsgBoxStyle.YesNo)
                If error1 = vbYes Then
                    txtuser.Clear()
                    txtpasword.Text = ""
                    txtuser.Focus()
                Else
                    End


                End If
            Else
                MsgBox("bye bye")
            End If

        End If

    End Sub


End Class


No hay comentarios:

Publicar un comentario