Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 29-03-2006, 11:17 PM   #1 (permalink)
Alpha Geek
 
godsownman's Avatar
 
Join Date: Feb 2005
Location: Bombay
Posts: 879
Default Visual Basic Query


I would like to know what is the code in VB to automatically stop an applications functioning after a fixed amount of executions.

What I mean is I want to create a application which can be used to trial purposes.

I want to know for curiosity sake.

Thanks
godsownman is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 30-03-2006, 12:22 AM   #2 (permalink)
Wise Old Owl
 
siriusb's Avatar
 
Join Date: May 2005
Location: Chennai, India, Asia, the Earth, the Solar system, the Milky Way, the Local group, this Universe.
Posts: 1,171
Default

Here's a simple way. You can create a hidden file or a registry key which holds a number. Your program, as soon as it's run, can check if the number is greater than allowed. If so, terminate program. Else, increment the number and run.
__________________
http://myxp.blogspot.com
-----------------------
Winchester 3200+ @2,500MHz
LeadTek 7900GT VOLT MODDED @ 680 core, 1800 mem
2x1GB Transcend DDR400 @ DDR454 2.5,3,3,5,1T
siriusb is offline  
Old 30-03-2006, 12:40 AM   #3 (permalink)
The No.1 Stupid
 
~Phenom~'s Avatar
 
Join Date: May 2005
Location: CYBERYARD
Posts: 1,708
Default

yeah , siriusb is quite right.
My friend was also telling me the same , when I had this query 2 months back. he said he has applied that succesfully.
__________________
n00b forever...
~Phenom~ is offline  
Old 30-03-2006, 11:04 AM   #4 (permalink)
Alpha Geek
 
godsownman's Avatar
 
Join Date: Feb 2005
Location: Bombay
Posts: 879
Default

To be honest, I am quite new to Visual Basic ,so I would greatly appreciate it if you all can please be a little more expressive it would aid me better.

Thanks
__________________
From the body of one guilty deed a thousand ghostly fears and haunting thoughts proceed !

Visit (http://www.meebo.com)
godsownman is offline  
Old 30-03-2006, 11:45 AM   #5 (permalink)
Wise Old Owl
 
siriusb's Avatar
 
Join Date: May 2005
Location: Chennai, India, Asia, the Earth, the Solar system, the Milky Way, the Local group, this Universe.
Posts: 1,171
Default

Here's a small routine to check the number of times a program has been run. You can put an if statement somewhere to terminate the program after some count. This method uses registry keys. You can try ini or a simpe txt or a mdb file.
Code:
Private Sub Form_Load()

Dim iCount As Integer
iCount = Val(GetSetting("SomeAppName", "SomeSectionName", "iCount", "1"))

MsgBox "You have run this program " & iCount & " times."
SaveSetting "SomeAppName", "SomeSectionName", "iCount", Str(iCount + 1)

End Sub
The registry key will be created in "HKEY_CURRENT_USER\Software\VB and VBA Program Settings". If u want to avoid tampering by the users, you can create multiple keys and/or files and save the value in all of them, so if one of them is compromised you can have other copies. BUt if the user is determined, he can use simple tools to find out which files you are using. Nobody's safe.
__________________
http://myxp.blogspot.com
-----------------------
Winchester 3200+ @2,500MHz
LeadTek 7900GT VOLT MODDED @ 680 core, 1800 mem
2x1GB Transcend DDR400 @ DDR454 2.5,3,3,5,1T
siriusb is offline  
Old 30-03-2006, 04:10 PM   #6 (permalink)
Alpha Geek
 
godsownman's Avatar
 
Join Date: Feb 2005
Location: Bombay
Posts: 879
Default

Thanks a lot siriusb.

I really appreciate the help.

I will try it out.

Thanks.
__________________
From the body of one guilty deed a thousand ghostly fears and haunting thoughts proceed !

Visit (http://www.meebo.com)
godsownman is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Tenida
- by clinton
- by gohan89
- by icebags

Advertisement




All times are GMT +5.5. The time now is 08:14 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2