Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 12-13-2005, 05:14 AM   #1 (permalink)
 
True Techie

Join Date: Dec 2004

Posts: 145

Mohan Giri

Default C# Windows application

Hi everyone,
how to make our application that has to expire after certain days???

Can anyone help me???

Thanks in advance....
Mohan Giri is offline  
Old 12-14-2005, 05:22 PM   #2 (permalink)
 
Ultra Techie

Join Date: Jul 2005

Posts: 530

TheHeadFL

Send a message via AIM to TheHeadFL
Default

Insert a key in the registry that holds the time when the application was first run. Then compare that to the current time, and if neccesary automatically exit the program.

Not very 'hacker proof' but its a simple solution.
__________________
Desktop machine: 2 x Opteron 246, Asus K8N-DL, 2GB PC3200 ECC Reg., XFX GeForce 6600GT, 74gb WD Raptor, 2 x 19\" LCDs, Windows XP x64
Server machine: Intel P4 3.0GHz 2MB EM64T, ECS i865pe, 1GB PC3200, 36gb WD Raptor, Windows Server 2003
Laptop: Dell Inspiron 9100 (Intel P4 3.2GHz 1MB Prescott, i865pe, 512MB PC3200, Mobility Radeon 9700, DVD+R/DL Burner), Windows XP
Linux: P3 450Mhz, 386MB ram, Slackware 10.1 (Running mySQL/Apache)
TheHeadFL is offline  
Old 12-16-2005, 04:02 PM   #3 (permalink)
 
True Techie

Join Date: Nov 2004

Posts: 133

duncan

Default

when I do something like this in Java there is a system variable returned by a function called "time in milliseconds" or something like that (I haven't looked at it for about a year) might be something similar in C which can be used to count from program launch. Failing that, there is a universal computer time as measured from some set date in the '70's I think (again, sorry about being vague - you'll have to look it up!) anyway, this can be accessed via a function and used to measure difference in time elapsed or an absolute date. If you don't find them then let me know and I'l try and look them up for you.
duncan is offline  
Old 12-16-2005, 05:36 PM   #4 (permalink)
 
Ultra Techie

Join Date: Jul 2005

Posts: 530

TheHeadFL

Send a message via AIM to TheHeadFL
Default

The time you're referring to is called the "CTIME" and is measured as the number of seconds from 12:00am January 1, 1970.
__________________
Desktop machine: 2 x Opteron 246, Asus K8N-DL, 2GB PC3200 ECC Reg., XFX GeForce 6600GT, 74gb WD Raptor, 2 x 19\" LCDs, Windows XP x64
Server machine: Intel P4 3.0GHz 2MB EM64T, ECS i865pe, 1GB PC3200, 36gb WD Raptor, Windows Server 2003
Laptop: Dell Inspiron 9100 (Intel P4 3.2GHz 1MB Prescott, i865pe, 512MB PC3200, Mobility Radeon 9700, DVD+R/DL Burner), Windows XP
Linux: P3 450Mhz, 386MB ram, Slackware 10.1 (Running mySQL/Apache)
TheHeadFL is offline  
Old 12-16-2005, 11:37 PM   #5 (permalink)
 
Super Techie

Join Date: May 2005

Posts: 479

furtivefelon

Default

hardcode it into your app when user install, and check with the clock every start.. Though you prob need a more clever solution than this..
__________________
lisp hacker
running: FreeBSD 5.4 - still learning
develop with: SBCL + emacs for lisp, Anjuta IDE +gcc for c, SPE for python..
browse with: opera
furtivefelon is offline  
 
Closed Thread

Thread Tools
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