From: Ramon F Herrera on 31 Aug 2009 13:13 I need to implement an (admittedly naive) run-time protection scheme. At least I would check the current date, any additional suggestion (with code! :-) are welcome. TIA, -Ramon
From: Nathan Mates on 31 Aug 2009 13:20 In article <2bc88e59-02a3-42c3-a476-4358762de54f(a)f33g2000vbm.googlegroups.com>, Ramon F Herrera <ramon(a)conexus.net> wrote: >At least I would check the current date, any additional suggestion >(with code! :-) are welcome. Pretty basic, but http://msdn.microsoft.com/en-us/library/1f4c8f33%28VS.80%29.aspx will tell you the # of seconds from 1970. Easy to convert that to a date. Not accurate if people reset their system clocks. Nathan Mates -- <*> Nathan Mates - personal webpage http://www.visi.com/~nathan/ # Programmer at Pandemic Studios -- http://www.pandemicstudios.com/ # NOT speaking for Pandemic Studios. "Care not what the neighbors # think. What are the facts, and to how many decimal places?" -R.A. Heinlein
From: Bob Masta on 1 Sep 2009 09:11 On Mon, 31 Aug 2009 12:20:44 -0500, nathan(a)visi.com (Nathan Mates) wrote: >In article <2bc88e59-02a3-42c3-a476-4358762de54f(a)f33g2000vbm.googlegroups.com>, >Ramon F Herrera <ramon(a)conexus.net> wrote: >>At least I would check the current date, any additional suggestion >>(with code! :-) are welcome. > > Pretty basic, but >http://msdn.microsoft.com/en-us/library/1f4c8f33%28VS.80%29.aspx >will tell you the # of seconds from 1970. Easy to convert that to a >date. Not accurate if people reset their system clocks. > In Windows, GetSystemTime will return a SYSTEMTIME structure with separate fields for year, month, day, etc. You can then use SystemTimeToFileTime to get a FILETIME quad word, which is the number of 100-nsec intervals since Jan 1, 1601 (UTC). This is a better format than SYSTEMTIME for comparing dates. Best regards, Bob Masta DAQARTA v4.51 Data AcQuisition And Real-Time Analysis www.daqarta.com Scope, Spectrum, Spectrogram, Sound Level Meter FREE Signal Generator Science with your sound card!
|
Pages: 1 Prev: User Rights Assignment in API Windows Opciones Next: Getting an idlist for a folder |