C# Windows application

Status
Not open for further replies.

Mohan Giri

In Runtime
Messages
144
Hi everyone,
how to make our application that has to expire after certain days???

Can anyone help me???

Thanks in advance....
 
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.
 
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.
 
The time you're referring to is called the "CTIME" and is measured as the number of seconds from 12:00am January 1, 1970.
 
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..
 
Status
Not open for further replies.
Back
Top Bottom