User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Mar 2008
Posts: 28
Reputation: Beginner2008 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Beginner2008 Beginner2008 is offline Offline
Light Poster

How do i make my program work for 5 times and then Expire

  #1  
Apr 3rd, 2008
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.
Attached Images
File Type: jpg 1.jpg (10.7 KB, 3 views)
File Type: jpg 2.jpg (25.7 KB, 3 views)
File Type: jpg 3.jpg (100.6 KB, 3 views)
File Type: jpg 4.jpg (100.6 KB, 3 views)
File Type: jpg 5.jpg (102.8 KB, 2 views)
File Type: jpg 6.jpg (25.7 KB, 1 views)
File Type: jpg no file.jpg (103.2 KB, 3 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Posts: 52
Reputation: bwkeller is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
bwkeller bwkeller is offline Offline
Junior Poster in Training

Re: How do i make my program work for 5 times and then Expire

  #2  
Apr 3rd, 2008
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).
Reply With Quote  
Join Date: Mar 2008
Posts: 28
Reputation: Beginner2008 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Beginner2008 Beginner2008 is offline Offline
Light Poster

Re: How do i make my program work for 5 times and then Expire

  #3  
Apr 3rd, 2008
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.
Reply With Quote  
Join Date: Feb 2008
Posts: 52
Reputation: bwkeller is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
bwkeller bwkeller is offline Offline
Junior Poster in Training

Re: How do i make my program work for 5 times and then Expire

  #4  
Apr 3rd, 2008
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.
Reply With Quote  
Join Date: Apr 2008
Location: The Netherlands
Posts: 8
Reputation: cetan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
cetan cetan is offline Offline
Newbie Poster

Re: How do i make my program work for 5 times and then Expire

  #5  
Apr 4th, 2008
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...
Reply With Quote  
Join Date: Feb 2008
Posts: 52
Reputation: bwkeller is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
bwkeller bwkeller is offline Offline
Junior Poster in Training

Re: How do i make my program work for 5 times and then Expire

  #6  
Apr 4th, 2008
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 4:45 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC