Hello students i know you need this codes, so i will provide it to you.. here are the some code's in visual basic 2007/2008... just analyze it!! ^_^

Home » Post Item » log-in form

log-in form

July 15, 2009

 

 Public Class PasswordForm
    Public nCounter As Integer                                            click this —->>>     

” This color RED text used to count the wrong access/input by the user. If he/she input more than 3 times, the program will automatically close ”

Private Sub btnpassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

 

 ” The VIOLET text used to access your database/Microsoft Access 

        Dim oRow As DataRow

        If Me.txtuser.Text = “” Then
            MsgBox(”Please Encode the User!”, MsgBoxStyle.Critical, “CONFIRM USER”)
            Me.lbldisply.Text = “Empty User!!!”
            nCounter = nCounter + 1
            If nCounter = 3 Then
                Me.Close()

            End If
        ElseIf Me.txtpassword.Text = “” Then
            MsgBox(”Please Encode the Password!”, MsgBoxStyle.Critical, “CONFIRM PASSWORD”)
            Me.lbldisply.Text = “Empty Password!”
            nCounter = nCounter + 1
            If nCounter = 3 Then
                Me.Close()

            End If
        Else
            For Each oRow In Me.RECORDSDataSet.PASS
                If (oRow.Item(”userid”) = Me.txtuser.Text) Then
                    If (oRow.Item(”password”) = Me.txtpassword.Text) Then
                        Form1.bAccess = True                     
                    End If
                End If
            Next
            If Form1.bAccess = True Then
                         Me.Close(
)
                End If

            Else
                MsgBox(”Incorrect User or Password”, MsgBoxStyle.Critical, “Access Denied!!!”)
                Me.lbldisplay.Text = “Access Denied!”
                nCounter = nCounter + 1
                If nCounter = 3 Then
                    Me.Close()

                End If
            End If
        End If
    End Sub

 

End Class



Public Class Form1
    Public bAccess As Boolean
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.bAccess = False
        PasswordForm.ShowDialog()
        If Not (bAccess) Then
            Me.Close()
        End If

    End Sub
End Class

Posted by visualcode at 5:58 pm | permalink

All comments are moderated. Your comments will not appear here unless approved by the blog owner. Thank you.

Add a comment