|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Last boot date/time infoHi
I once saw that boot date and time could be found in the registry somewhere.... Now, I can't find it again, and I also tryed google for some hints but failed. pls, say it's possible to get last boot date/time, and maybe a hint how to do it, or where to look for it.... Yours, Kjell On Fri, 14 Oct 2005 05:30:03 -0700, "Kjell"
<Kj***@discussions.microsoft.com> wrote: > Not sure where (or if) it's stored in the registry, but here's two>I once saw that boot date and time could be found in the registry >somewhere.... > >Now, I can't find it again, and I also tryed google for some hints but failed. > >pls, say it's possible to get last boot date/time, and maybe a hint how to >do it, or where to look for it.... ways to do it with the Api. 1) GetTickCount - returns # of millisecs since last boot. Note this one wraps every 49 days, plus with VB's signed Long, goes negative after 24. 'declaration... Public Declare Function GetTickCount Lib "kernel32" () As Long 'usage... Dim lBootDate As Date lBootDate = DateAdd("s", -CDbl(GetTickCount() \ 1000), Now) Debug.Print lBootDate 2) QueryPerformanceCounter, QueryPerformanceFrequency. 'declares... Public Declare Function QueryPerformanceCounter Lib "kernel32" _ (lpPerformanceCount As Currency) As Long Public Declare Function QueryPerformanceFrequency Lib "kernel32" _ (lpFrequency As Currency) As Long 'usage... Dim cFreq As Currency, cCount As Currency Dim BootDate As Date If QueryPerformanceFrequency(cFreq) <> 0 Then QueryPerformanceCounter cCount BootDate = DateAdd("s", -(cCount / cFreq), Now) Debug.Print BootDate End If -Tom MVP - Visual Basic (please post replies to the newsgroup)
?creating activex control?
Ping Ken Halter VBA and ADODB.Recordset question Font Dialog Box kill a proccess for a specific user Newbie: ADO - Access Connection string Software protection against cracks and piracy Resizing text boxes user-defined type not defined Determine when report printed to specific printer |
|||||||||||||||||||||||