473,480 Members | 2,347 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to Get Server Reboot Time?

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
1 2388
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4440
by: Ben Allen | last post by:
Is there a way (through a variable) to show the date of the last server reboot i.e. when PHP last started running? As I am trying to show the server uptime, which of course only works from the last...
2
15202
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
19
14799
by: Thue Tuxen Sørensen | last post by:
Hi everybody ! I´m maintaining a large intranet (approx 10000 concurrent users) running on one IIS box and one DB box with sqlserver 2000. Currently there is 2,5 GB Ram, 1 1400 mhz cpu and 2...
10
7275
by: JL | last post by:
To All, I have a SQL2KSP3a database(<1GB) running on a 4x3GB physical CPU with 4GB of ram. It is Windows Server 2003 with hyper-threading turn on. There are ~420 .Net users/cxns (fat client, no...
2
2140
by: Tim Nelson | last post by:
I created a simple C# .Net application to prove I can deploy it on a Win2k server running terminal services. I installed the 1.1 .Net Framework and installed the application (using a VS Setup app)...
1
3143
by: Keith | last post by:
All, I have been told this is an ASP.NET issue and not an IIS issue, so I am posting this here. I have a problem with ASP.NET returning an HTTP 500 error when trying to run ASPX pages on...
1
275
by: Josh | last post by:
The error I am getting is the following. ALong with the error asp doesnt start and the web site is down until I reregister asp service. Event Type: Error Event Source: ASP.NET...
0
287
by: rooster575 | last post by:
I have a strange situation whereby I must un-install and re-install ASP.NET every time I reboot the server. When the server is rebooted and I try to access a web application it reads: "Server...
5
2322
by: war_wheelan | last post by:
I created the db with the attached script and I am able to access it until I reboot the server. I've tried enabling flag 1807 via the SQL server service and the startup parameters of the instance....
39
2813
by: cj | last post by:
I have a 2005 TCP/IP server that creates a new thread to handle each incoming TCP/IP request. Once the request has been answered by the thread the TCP/IP socket is disconnected and the sub/thread...
0
7054
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4493
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.