1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| Option Explicit
Dim m_lNofTries As Long
Dim SERIAL As String
Dim y As String
Dim x As New MADAGASCAR.XP10
Private Sub Form_Load()
Text9.Text = CPU1proccesor
SERIAL = Text1 + Text2 + Text3 + Text4 + Text5 + Text6 + Text7 + Text8
Text9.Locked = True
y = GetSetting("MADA", "test", "S1", Text1 + Text2 + Text3 + Text4 + Text5 + Text6 + Text7 + Text8)
End Sub
Private Sub Command1_Click()
SERIAL = Text1 + Text2 + Text3 + Text4 + Text5 + Text6 + Text7 + Text8
Me.Caption = SERIAL
If UCase(SERIAL) = UCase(x.MD5(Trim$(Text9.Text))) Then
MsgBox "CONGRATULATION .. PROGRAM ACTIVATED ", vbOKOnly
SaveSetting "MADA", "test", "S1", Text1 + Text2 + Text3 + Text4 + Text5 + Text6 + Text7 + Text8
Unload Me
Form2.Show
Else
m_lNofTries = m_lNofTries + 1
If m_lNofTries < 3 Then
MsgBox "wrong serial .. remaining " & 3 - m_lNofTries & " attempt ( s )"
ElseIf m_lNofTries = 3 Then
MsgBox " 3 wrongs attempts ..good bye ", vbCritical
Unload Me
End If
End If
End Sub
Private Function CPU1proccesor() As String
Dim computer As String
Dim wmi As Variant
Dim processors As Variant
Dim cpu As Variant
Dim cpu_ids As String
computer = "."
Set wmi = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & computer & "\root\cimv2")
Set processors = wmi.ExecQuery("Select * from Win32_Processor")
For Each cpu In processors
cpu_ids = cpu_ids & ", " & cpu.ProcessorId
Next cpu
If Len(cpu_ids) > 0 Then cpu_ids = Mid$(cpu_ids, 3)
CPU1proccesor = cpu_ids
End Function |
Partager