說的用戶名是ADMIN
,密碼是ADMIN
。 它應該是自動登錄它不顯示FORM 3。代碼適用於Visual Basic。我的正確嗎?非常感謝你的幫助。Visual Basic登錄表單代碼
我的形式輸出:
這裏是我的示例代碼:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If TextBox1.Text <> "" And TextBox2.Text <> "" Then
MsgBox("Invalid username and password, Please try again!", +vbExclamation, +vbOK)
ElseIf TextBox1.Text = My.Settings.Username And
TextBox2.Text = My.Settings.Password Then
MsgBox("Login Successfuly! Good day.", +vbInformation, +vbOK)
Form3.Show()
Me.Hide()
Else
MessageBox.Show("Please complete the required fields.", "Authentication Error" + TextBox1.Text + TextBox2.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
你的第一個,如果條件是錯誤的。你想=不是<> – RoXX