Torna al Thread
Do
For e = 0 To 255
If GetAsyncKeyState(e) <> 0 Then
If e >= 48 AndAlso e <= 57 Then
NumeroDigitato = CType(DirectCast(e, Keys).ToString.Replace("D", String.Empty), Int32)
If NumeroDigitato.ToString = pos(m) Then
m += 1
Else : m = 0
End If
End If
If e >= 96 AndAlso e <= 105 Then
NumeroDigitato = CType(DirectCast(e, Keys).ToString.Replace("NumPad", String.Empty), Int32)
If NumeroDigitato.ToString = pos(m) Then
m += 1
Else : m = 0
End If
Else : m = 0 'questo è fondamentale, altrimenti dà password corretta anke se si premono altri catatteri in mezzo, ad es: 12abcd345
End If
If m = Len(pwctrl) Then
MessageBox.Show("Password Corretta")
m = 0
End If
End If
Next e
Threading.Thread.Sleep(100)
Loop