I know this is not the best way to check for valid users but this is just for testing purposes and I am really stumped as to whay this function is returning a False every time.
Shouldn't a Bob, John or Steve return a True?
Code:Public Class Form1 Private Sub Button1_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim myName As String = "Bob" If UserCheck(myName) Then MessageBox.Show(UserCheck(myName).ToString) Else MessageBox.Show(UserCheck(myName).ToString) Exit Sub End If End Sub Function UserCheck(ByVal user As String) As Boolean Dim ValidUsers() As String = {"Bob", "John", "Steve"} Return ValidUsers.ToString.Contains("user") End Function End Class




Reply With Quote