VB.Net login example for DE

Public Class Login

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Application.Exit()
    End Sub

    Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
        Dim sUname As String
        Dim sPass As String

        sUname = txtUname.Text
        sPass = txtPass.Text

        If sUname = "aung" And sPass = "123" Then
            Form1.Show()
            Me.Hide()
        Else
            MessageBox.Show("wrong password, try again")
            txtUname.Text = ""
            txtPass.Text = ""
            txtUname.Focus()

        End If
    End Sub


End Class

Comments