|
-
Sep 21st, 2011, 10:36 PM
#1
Thread Starter
Member
Adding a login
I want to make a login for my application, not using a database, for now.
I figured something like this:
Code:
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
If UsernameTextBox.Text = "Josh" & PasswordTextBox.Text = "mypass1" Then
Me.Hide()
Else If
MsgBox("Sorry User Name Or Passord Is Incorrect")
End If
End Sub
Im getting a cannot convert to boolean or something.
Please help, very new to this. Some Java experience
-
Sep 21st, 2011, 10:47 PM
#2
Thread Starter
Member
Re: Adding a login
Actually I think i got it.
Code:
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
If UsernameTextBox.Text = "Josh" AndAlso PasswordTextBox.Text = "mypass1" Then
MsgBox("Login Successful")
Form1.Show()
Me.Hide()
End If
End Sub
Only one thing:
Doing this only hides the login form. I tried Me.Close() but it closes the whole program.
Is there an IgnoreCase function to make the fields case insensitive
Last edited by Jtsou; Sep 21st, 2011 at 10:51 PM.
-
Sep 21st, 2011, 11:12 PM
#3
Re: Adding a login
Follow the CodeBank link in my signature and check out my WinForms Login thread.
The String.Equals function can be case-sensitive or -insensitive.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|