By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,916 Members | 1,286 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,916 IT Pros & Developers. It's quick & easy.

How to Get Server Reboot Time?

P: n/a
I am writing in C# .NET and am using System.Environment.TickCount
(32-bit integer) to get the number of milliseconds since the server was
rebooted.

The problem is that the server has been up for over 30 days and the
32-bit integer is coming back negative. Of course, I can extend it
with zeros and make it a 64-bit integer, but what will happen after 60
days or so?

Will the C# code then loop around through zero and start reporting a
low number of milliseconds?

Or, better yet, was it a sure-fire way to find out when the server was
rebooted?

(I can use WMI if necessary).

May 31 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
http://www.codeproject.com/aspnet/we...select=1114596
includes an example using WMI

Cheers,

Greg Young
MVP - C#
http://geekswithblogs.net/gyoung
<sa*******@gmail.com> wrote in message
news:11*********************@c74g2000cwc.googlegro ups.com...
I am writing in C# .NET and am using System.Environment.TickCount
(32-bit integer) to get the number of milliseconds since the server was
rebooted.

The problem is that the server has been up for over 30 days and the
32-bit integer is coming back negative. Of course, I can extend it
with zeros and make it a 64-bit integer, but what will happen after 60
days or so?

Will the C# code then loop around through zero and start reporting a
low number of milliseconds?

Or, better yet, was it a sure-fire way to find out when the server was
rebooted?

(I can use WMI if necessary).

May 31 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.