Option Explicit
Dim As Single b
Private Sub Command1_Click ()
Dim a, s, n %
"C: \ 1. TXT" Open For Input As # 1
The Do While Not EOF (1)
The Line Input # 1, s
A=Split (Trim (s), "")
If Text1. Text=a (0) And Text2. Text=a (2) Then
Loop
Form1. Hide
The Load Form2
Form2. Show
The Else
MsgBox "password error! Please input again!"
Text2. Text=""
If b=2 Then
MsgBox "sorry wrong password to lose three times after the bank automatic swallowing card!"
Command1. Enabled=False
Command2. Enabled=False
End the If
End the If
B=b + 1
End Sub
I don't really know how to change the LOOP and I don't know where is the user password for now and can't get into
CodePudding user response:
A=Split (Trim (s), "")Trim (s) have already put in the string s Spaces all cleared, can also detect the Spaces?
CodePudding user response:
Option Explicit
Dim As Single b
Private Sub Command1_Click ()
Dim a () As String, s As String, success As a Boolean
"C: \ 1. TXT" Open For Input As # 1
Do Until EOF (1)
The Line Input # 1, s
A=Split (Trim (s), "")
If Text1. Text=a (0) And Text2. Text=a (2) Then
Success=True
The Exit Do
End the If
Loop
Close # 1
If success Then
B=0
Form1. Hide
The Load Form2
Form2. Show
The Else
B=b + 1
If b=3 Then
MsgBox "sorry wrong password to lose three times after the bank automatic swallowing card!"
Command1. Enabled=False
Command2. Enabled=False
The Else
MsgBox "password error! Please input again!"
Text2. Text=""
End the If
End the If
End Sub
CodePudding user response: