テキストボックスを使用してVBでログインスクリプトを作成しています。私の問題は、試行が残っていることをユーザーに通知する msgbox がループし続け、(3) 回の試行をすべて使い果たしていることです。何が悪いのかわからない。
ここに私のコードがあります:
Dim cor_pw As String = "1234"
Dim cor_us As String = "abcd"
Dim tries1 As Integer = 3
tries1 -= 1
Do
MsgBox("wrong combination, " & tries1 & " chances left to make it right.")
Loop Until textbox1.Text = cor_us And textbox2.Text = cor_pw Or tries1<= 0
If textbox1.Text = cor_us And textbox2.Text = cor_pw Then
MsgBox("Congratulations! That's Correct!")
Else
MsgBox("You've used all tries! " & tries1 & " chances left, good bye!")
Me.Close()
End If