ACTIVELOCK

USUARIO.EXCLUIDOS 16/03/2004 16:19:57
#15627
Alguém teria um exemplo de manipulação com o activelock para eu ter uma noção de como se usa?
Obrigado a todos
CAJU 16/03/2004 21:01:06
#15666
Resposta escolhida
Option Explicit

Private Sub cmdRegister_Click()
ActiveLock1.LiberationKey = Text2
If ActiveLock1.RegisteredUser Then
frameRegister.Visible = False
MsgBox "Thanks for registering!"
Command1.Enabled = True
Command2.Enabled = True
cmdUnRegister.Enabled = True
Else
MsgBox "Wrong key, try again!"
Text2.SelStart = 0
Text2.SelLength = Len(Text2)
Text2.SetFocus
End If
End Sub

Private Sub cmdUnRegister_Click()
Dim R As VbMsgBoxResult
R = MsgBox("Are you sure that you want to unregister this software?", vbYesNo)
If R = vbYes Then
ActiveLock1.LiberationKey = "0"
Unload Me
End If
End Sub


Private Sub Form_Load()
' If the user hasn't registered yet,
' shows the registration frame
If ActiveLock1.RegisteredUser Then
frameRegister.Visible = False
Else
Text1 = ActiveLock1.SoftwareCode
Text2 = ""
Label1 = "You've been using this software for " _
& ActiveLock1.UsedDays & " day(s)."
Command1.Enabled = False
Command2.Enabled = False
cmdUnRegister.Enabled = False
End If
End Sub
CAJU 16/03/2004 21:08:35
#15667
Ah.... e para vc usar com contagem regressiva de dias:


Option Explicit

' This sample project requires ActiveLock control
' You may download ActiveLock free of charge at
' http://www.insite.com.br/~nferraz/activelock

Sub Main()

Load frmRegister
Load Calculator

With frmRegister.ActiveLock1
' If the user have registered, then shows the main form
If .RegisteredUser Then
Calculator.Show
Else
' If he/she haven't registered yet, check if
' the user tried to fool ActiveLock by changing
' the time settings
If .LastRunDate MAIOR Now Then
MsgBox "ActiveLock has detected that you've changed the clock backwards!"
End If

' Check the evaluation period
If .UsedDays MENOR 21 Then
frmRegister.Show 1
Calculator.Show
Else
' If the evaluation period has expired...
MsgBox "Your evaluation period has expired!"
Unload frmRegister
Unload Calculator
End If
End If
End With

End Sub
Tópico encerrado , respostas não são mais permitidas