How do i make my program work for 5 times and then Expire and will never work again ? In which i'll have to rebuild a new one using VB so that it will work for another 5 times more.The approach i used is as follows.

I created a text file with the name zxs.txt and set it as a counter for the program:







So now to make the program open i'll have to open that text file and set the value to zero. Now what im after is:

I want the program to run for 5 times, when it expires i want to manually create the zxs.txt file run the program so that the number of trials is back to zero."Then i run the program so that it resets the trial from the text file".Then safely i can delete the text file , moreover i want to make this step as a secret. Now what happens when i run the program without that file is:


Instead i want the program to run and make the zxs.txt a secret way to reset the program. If anyone how any idea how to do so please come forward. Any other suggestions are welcomed.

Attachments 4.jpg 100.59 KB 5.jpg 102.8 KB 6.jpg 25.74 KB no_file.jpg 103.25 KB
8 Years
Discussion Span
Last Post by bwkeller

To do something like this I would require an Internet connection and keep track of number of runs in an Access or SQL database based on the machine name on which the application is running and the application version number (or on a key created in the installation program and which would be stored in the registry in a number of related formats for security).


Thanx. But i need this for a presentation im selling nothing. Generating ideas and this part particulary i'll include in my conclusion where i can show the examiners what i can do with the program i built so i dont need to do it in the registery.

Situation: Program is working fine for 5 times then it expires. zxs.txt is a must for the program to run.

What i want:Program to work for 5 times and expires. zxs.txt is optional for the program to run.

So basically when the program runs for the first 5 trials i want it to run without the zxs.txt file. When the program expires. I want the only way to get it back to work is this:

create a file with the name zxs.txt.
set the value to 0.
run the program.
delete the zxs.txt file again.


A point of confusion:

How are you going to keep track of the number of times the program is run without saving that information externally? Even my.settings values are saved externally.


Indeed, you need to store the 'number of runs' information somewhere...!!!

Best, but not always possible, is to keep track of runs using an internet connection (as described by bwkeller)

Otherwise you need to store it locally... for instance in a config file or the registry.
But of course this is fairly easy 'crackable'

I have once (long time ago, I believe in a C++ program) used an 'hidden' entry in the registry for the counter; I stored the counter encrypted, adding several variables to it. This helps protecting it against the 'cracking' possibility... somewhat...


On the other hand, if this is just a presentation and you don't care that the data is stored externally, you can use the my.settings values.

Create the program with a "TimesRun" User value of 0 and increment it on each program load. When it reaches 5 exit the program if the zxs.txt file is not found. If it is found delete it and reset the "TimesRun" to 1.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.