Question
On VB.NET, I have the following code for a password screen that appears when the form loads. How can I make the password be in
On VB.NET, I have the following code for a password screen that appears when the form loads.
How can I make the password be in the following form: MSG-##
The M, S, and G can be lower or upper case and the #'s can be any number
Private Sub MainScreen_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'Show password form as dialog box Dim InputPassword As String = "", Count As Integer = 1 Dim GoodWord As String = "MSG" Do While Count <= 3 InputPassword = InputBox("Please enter your password. Case is important", "Employee Aplication System Password Attempt #" & Count) If InputPassword = GoodWord Then MsgBox("Congratulations") Exit Sub End If MsgBox("Sorry, this password is incorrect. Please try again.") Count += 1 Loop MsgBox("Failed password.") End
Dim UserName, SSN As Single UserName = txtFirst.Text + txtLast.Text SSN = txtSSN.Text End Sub
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started