Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15206

I need help

$
0
0
I have been working on this user validation code for over 6 hours and cannot get it to work. There are 3 users that are hardwired in there and and error user. However, when I click the button it does not run the code or even display an error message. Ill post my code below and I just need another set of eyes to see what could be fixed. I am using VB 2017 with windows form.
Code:

Public Class frmID
    Private Sub btnAuthenticate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAuthenticate.Click
        'Declarations
        'Constants
        'First Names
        Const strKaz As String = "Kaz"
        Const strEmika As String = "Emika"
        Const strNesta As String = "Nesta"
        Dim strNotFirstName As String

        'Last Names
        Const strBrekker As String = "Brekker"
        Const strChen As String = "Chen"
        Const strArcheron As String = "Nesta"
        Dim strNotLastName As String

        'Emails
        Const strKazEmail As String = "kaz.brekker@crowclub.com"
        Const strEmikaEmail As String = "emika.chen@warcross.com"
        Const strNestaEmail As String = "nesta.archeron@valkyrie.com"

        'ID
        Const decKazID As Decimal = 4800587568
        Const decEmikaID As Decimal = 4800598746
        Const decNestaID As Decimal = 4800215649

        'Full Names
        Const strKazFullName As String = strKaz + strBrekker
        Const strEmikaFullName As String = strEmika + strChen
        Const strNestaFullName As String = strNesta + strArcheron

        'Success and Fail
        Dim strSuccess As String
        Dim strFail As String
        Dim strNotFound As String

        'Error
        Dim strError As String

        'authenticate
        Dim authenticate As String

        'Input
        'Strings
        strSuccess = "Success"
        strFail = "Fail"
        strNotFound = "User Not Found"

        'Error
        strNotFirstName = txtFirst.Text
        strNotLastName = txtLast.Text
        strError = strNotFirstName + strNotLastName

        'authenticate

        'Processing
        'Case of people
        Select Case authenticate
            Case Is = strKazFullName
                If txtID.Text = strKazEmail Or decKazID Then
                    'Output
                    lblAuthenticate.Text = strSuccess.ToString
                Else
                    'Output
                    lblAuthenticate.Text = strFail.ToString
                End If
            Case Is = strEmikaFullName
                If txtID.Text = strEmikaEmail Or decEmikaID Then
                    'Output
                    lblAuthenticate.Text = strSuccess.ToString
                Else
                    'Output
                    lblAuthenticate.Text = strFail.ToString
                End If
            Case Is = strNestaFullName
                If txtID.Text = strNestaEmail Or decNestaID Then
                    'Output
                    lblAuthenticate.Text = strSuccess.ToString
                Else
                    'Output
                    lblAuthenticate.Text = strFail.ToString
                End If
            Case Is = strError
                'Output
                lblAuthenticate.Text = strNotFound.ToString
        End Select

    End Sub
End Class


Viewing all articles
Browse latest Browse all 15206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>