Click to See Complete Forum and Search --> : Total Uptime
I was wondering if there was a way to get the total amount of time the computer has been running. When I say total, I mean the combined amount since the operating system was installed.
gwdash
Oct 8th, 2000, 09:33 PM
GetTickCount will get the time since windows was loaded. How about the time since the Windows Folder Was Modified, don't have code now, but i can tell you how
Note: Funcitons in Italics are API's, functions in Bold are built into VB
Open the Windows Folder With CreateFile
Use GetFileTime to get the time created
Use FileTimeToLocalFileTime to get it local
Use FileTimeToSystemTime to get into structure
Put into a Date with DateSerial
Use DateDiff to compare result of above with Now
Sorry, that i don't have code now
Yeah, I have gotten ideas like that from other people. There is a problem with that. Wouldn't it only tell you how long you have had your computer with Windows on it? Not how long your computer has been on with Windows on it.
gwdash
Oct 9th, 2000, 09:14 PM
The only way I can think of is to use GetTickCount and add the times up, but that would have to be done on loggoff and would only start counting now. Just Curious, why do you need this?
I made a program on my website for free distrobution. Just wanted to know if it were possible.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.