View previous topic :: View next topic |
Author |
Message |
Renegade
Joined: 30 Apr 2005 Posts: 45
|
Posted: Sun Jun 05, 2005 12:26 am Post subject: monitor.Invalid returning true |
|
|
Hello,
I've got monitor.Invalid returning true when it shouldn't.
I've been using it during development, and my trial period has "expired" on the installed version on my dev box, but in my IDE (VS.NET 2003) I'm getting my dates returned right, but monitor.invalid is true for some reason.
Everything was working right but I was adding and changing some of the app functionality for a new version. Then all of a sudden on day 4 of a 10 day trial, monitor kills the trial period:
Code: |
' In main app globals:
Private monitor As New EvaluationMonitor(System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString.GetHashCode.ToString)
' in start up
If monitor.DaysInUse > 10 Or monitor.Invalid Then
' Disable stuff blah blah
|
Am I doing something wrong?
Thanks |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun Jun 05, 2005 11:32 pm Post subject: |
|
|
The monitor.Invalid flag is used to detect clock winding by the end user. The monitor checks that the clock has not been wound back since the last time the software was run (with some allowance for minor time changes -eg dayligh saving adjustments etc). If it has then the Invalid flag will be set. Most likely you may have triggered this mechanism while testing the evaluation period by changing your system clock.
If you don't want to be this cautious you can simply ignore the Invalid flag in your code and only check the DaysInUse property. _________________ Infralution Support |
|
Back to top |
|
|
Renegade
Joined: 30 Apr 2005 Posts: 45
|
Posted: Mon Jun 06, 2005 12:46 am Post subject: |
|
|
I didn't actually change the clock - and it all seems to be working fine now. I don't know what was going on though. I had changed some other code that wasn't related to licensing when I got the invalid returning true.
I do have my own software installed on my dev box, so I was wondering if there's anything there that might trigger it.
Thanks |
|
Back to top |
|
|
|