Discussion Locked

Visual Basic Help

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am developing an application using VB. I want to make a trial version of the software, either use a number of times usage or date restricted. Does anyone know what code I will use for this?

9 replies

by rolie

I don't know the exact code to be use in VB. I know more about VC++. But i'll give you a hint.

To do the code you must messed up a little bit of your registry. You must have a function in your code that will add a variable to the registry that will act as a counter. Of how many days the trial is allowed or maybe the expiration date of the software. You need to make this in the registry so that even the user tried to install the software again, he can't use the software anymore. Remember this, if you uninstall a program, the files are deleted but the entry in the registry remains. But issue can arise if the user of the software is an expert in system programming or manipulating the registry because he can always delete the registry variable to use the software again.

Hope this idea helps you!

by rrv

With you application add one more data file without which the application would'nt work. Make sure that file will not be edited by puting in a systems folder or hiding or making it read only. Write the number of times your application is used insidethis file programatically in a way that your program only can read. you may use unicode or use any algorithm to apply a formula on each character you write.
With this logic you can control without using second party tools or utilities. This does not require registry at all.
RV

by rucus99_

Not foolproof ... but simple.

In the Form_Load()procedure use a line of code:

If Date < "08/25/02" Or Date > "09/25/02" Then GoTo TerminateApp

where TerminateApp: is in the Form_Load() procedure: many variations of this as you can seeIf Date < "08/25/02" Or Date > "09/25/02" Then Form_Terminate()

by tsl

I would suggest writing a number a values to the registry. One value would be hidden in some obscure place and would just let your program know that it has been installed. The other value should be an encrypted number that tells how many time yourprogram has run. If the program sees the first value but not the second it exits because the user tried to cheat it. If both values are there then it goes through a loop comparing the second value to a temporary encrypted number (0 to maxUses) if the compare shows a match the the program continues else it ends. To encrypt use the following code:
Public Function Keycode(Password As String) As Long
Dim I As Integer
Dim Hold As Long
For I = 1 To Len(Password)
Select Case (Asc(Left(Password, 1)) * I) Mod 4
Case Is = 0
Hold = Hold + (Asc(Mid(Password, I, 1)) * I)
Case Is = 1
Hold = Hold - (Asc(Mid(Password, I, 1)) * I)
Case Is = 2 Hold = Hold + (Asc(Mid(Password, I, 1)) * _
(I - Asc(Mid(Password, I, 1))))
Case Is = 3
Hold = Hold - (Asc(Mid(Password, I, 1)) * _
(I + Len(Password)))
End Select Next I
Keycode = Hold
End Function

This discussion is closed to new replies.