Good day
Can you please help me with my codes. My teacher tasked us to make a program that will accept a password from the input box then will show form1. Otherwise, it will repeat on asking for the correct password. the program will stop asking if you gave the correct password or if incorrect password is given three times.
I tried to make this program using loop because our lesson was looping but it did not worked. So i tried to use if statement. but it worked the other way around. so instead of accepting rc as the password (which set as the password), it was rejected instead.
Here is the code i used
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim x As String = InputBox("Password")
Dim y As String = InputBox("Incorrect")
Dim frm As New Form1
If x = "rc" Then
frm.Show()
Else
If y = "rc" Then
frm.Show()
Else
If y = "rc" Then
frm.Show()
Else
If y = "rc" Then
frm.Show()
Else
frm.Close()
End If
End If
End If
End If
End Sub
End Class
Please help me with this.