Keith,
The "System Up Time" performance counter has the "time elapsed since the
computer was started", you can use something like to retrieve its value:
Dim counter As New PerformanceCoun ter("System", "System Up Time")
Dim seconds As Double = counter.NextVal ue()
seconds = counter.NextVal ue()
Dim startTime As DateTime = DateTime.Now.Ad dSeconds(-seconds)
Note the two calls to NextValue are needed, due to the way
PerformanceCoun ter works.
I was thinking Environment.Tic kCount would be an alternative, however its
value is limited to 24.9 hours...
I'm not sure if there is a "better" Win32 API, as the GetTickCount API
references the "System Up Time" counter...
Not sure if the above would be supported on Windows 98.
Hope this helps
Jay
"GTDriver" <GT******@discu ssions.microsof t.com> wrote in message
news:56******** *************** ***********@mic rosoft.com...
I would like to know if there is function in VB.NET that returns the date
and
time someone last turned on/off the computer? I'm more interested in
knowing
this on a non-networked computer. Maybe there is already an .exe in the
windows operating system that performs this task.
How can I get the above requested info?
--
Sincerely,
Keith