•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 426,485 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,242 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 408 | Replies: 5
![]() |
•
•
Join Date: Mar 2008
Posts: 28
Reputation:
Rep Power: 1
Solved Threads: 0
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:
[IMG]http://aycu02.webshots.com/image/50401/2003132311733705204_rs.jpg[/IMG]
[IMG]http://aycu02.webshots.com/image/49361/2003146129555759376_rs.jpg[/IMG]
[IMG]http://aycu16.webshots.com/image/48455/2003192850565848467_rs.jpg[/IMG]
[IMG]http://aycu31.webshots.com/image/49470/2003198145601460352_rs.jpg[/IMG]
[IMG]http://aycu38.webshots.com/image/48117/2003181538405605232_rs.jpg[/IMG]
[IMG]http://aycu17.webshots.com/image/50136/2003101883989991303_rs.jpg[/IMG]
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:
[IMG]http://aycu28.webshots.com/image/48667/2001406850393645200_rs.jpg[/IMG]
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.
I created a text file with the name zxs.txt and set it as a counter for the program:
[IMG]http://aycu02.webshots.com/image/50401/2003132311733705204_rs.jpg[/IMG]
[IMG]http://aycu02.webshots.com/image/49361/2003146129555759376_rs.jpg[/IMG]
[IMG]http://aycu16.webshots.com/image/48455/2003192850565848467_rs.jpg[/IMG]
[IMG]http://aycu31.webshots.com/image/49470/2003198145601460352_rs.jpg[/IMG]
[IMG]http://aycu38.webshots.com/image/48117/2003181538405605232_rs.jpg[/IMG]
[IMG]http://aycu17.webshots.com/image/50136/2003101883989991303_rs.jpg[/IMG]
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:
[IMG]http://aycu28.webshots.com/image/48667/2001406850393645200_rs.jpg[/IMG]
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.
•
•
Join Date: Feb 2008
Posts: 52
Reputation:
Rep Power: 1
Solved Threads: 6
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).
•
•
Join Date: Mar 2008
Posts: 28
Reputation:
Rep Power: 1
Solved Threads: 0
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.
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.
•
•
Join Date: Apr 2008
Location: The Netherlands
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 1
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...
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...
•
•
Join Date: Feb 2008
Posts: 52
Reputation:
Rep Power: 1
Solved Threads: 6
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.
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- GDI information please (Advertising Sales Strategies)
- Forms Authorization/ Authentication using asp .net and vb .net (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: DataGridView with SubHeaders
- Next Thread: retreiving data onto a combo box on VB form.


Linear Mode