Torna al Thread
Private Sub get_num()
Dim pwctrl As String
Dim pos() As String
Dim NumeroDigitato As Integer
Dim password As String = String.Empty
Dim c As Integer
Dim m As Integer = 0
pwctrl = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\PcLockInfo", "Pw", Nothing)
If pwctrl <> "" Then
ReDim pos(0 To Len(pwctrl) - 1)
For i = 0 To Len(pwctrl) - 1
c += 1
pos(i) = Mid(pwctrl, c, 1)
Next i
' Else
' Pwset.Show()
End If
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
' Else : m = 0
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
End If
If m = Len(pwctrl) Then
MessageBox.Show("Password Corretta")
m = 0
End If
End If
Next e
Threading.Thread.Sleep(100)
Loop
End Sub