473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Is there a way to know for how much time the system has not been rebooted?

Hi,
When I open my MIRC, it tells me "x days xx hours xx minutes xx seconds
have passed since your system last rebooted". I wanted to know if there is
some way to know this information within .NET.

Thanks

ThunderMusic
Aug 15 '05 #1
3 1215
Wil
TM,

System.Diagnostics.PerformanceCounter pc = new
System.Diagnostics.PerformanceCounter("System", "System Up Time");
pc.NextValue();
TimeSpan span = System.TimeSpan.FromSeconds(pc.NextValue());
Console.WriteLine("Uptime = " + span.ToString());

Enjoy,

- William Bloodworth

Aug 15 '05 #2
thanks a lot

"Wil" <wh**********@hotmail.com> a écrit dans le message de
news:11**********************@g44g2000cwa.googlegr oups.com...
TM,

System.Diagnostics.PerformanceCounter pc = new
System.Diagnostics.PerformanceCounter("System", "System Up Time");
pc.NextValue();
TimeSpan span = System.TimeSpan.FromSeconds(pc.NextValue());
Console.WriteLine("Uptime = " + span.ToString());

Enjoy,

- William Bloodworth

Aug 15 '05 #3
TickCount Property of the Environment type returns the number of
milliseconds elapsed since the system started.

HTH, Metallikanz!

"ThunderMusic" <NO*******@sympatico.caSPAMATALL> wrote in message
news:Ow**************@TK2MSFTNGP14.phx.gbl...
Hi,
When I open my MIRC, it tells me "x days xx hours xx minutes xx seconds
have passed since your system last rebooted". I wanted to know if there is
some way to know this information within .NET.

Thanks

ThunderMusic

Aug 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tom | last post by:
Is it possible to create a button that will gzip a file from a web page ?? The have the page display another button, when the gzip is complete ?? The button should allow us to issues a system...
3
by: Bryan Martin | last post by:
I have a program which has ran every night fine until last night. Now it bombs with the following errors. I have also broke this down to its simplest form for sending the mail...
3
by: Bernd Giegerich | last post by:
Hi, we had a strange problem with DB2 8.2 Enterprise Edition on Windows 2003 (Standard) Server. We installed DB2 8.2 (8.1.7) directly on a naked W2K3 system (no migration, no update -> no...
2
by: J M | last post by:
I rebooted a network device just few minutes ago and getting device-up-time value 3191. How do I convert a time elapsed in days hours minutes and seconds for above value? Example: This device...
3
by: ThunderMusic | last post by:
Hi, When I open my MIRC, it tells me "x days xx hours xx minutes xx seconds have passed since your system last rebooted". I wanted to know if there is some way to know this information within...
1
by: samtilden | last post by:
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...
4
by: DaTurk | last post by:
I want to know when a socket disconnects so I can attempt to reconnect. Is there any special type of pattern to doing this? Is there an evnt raised?
9
by: =?Utf-8?B?RCBKYXJ2aWU=?= | last post by:
A VB.NET 2003 application accesses a custom VB 6 DLL. It has run successfully several months, and has been modified without problem a few times during that period. Recently another set of changes...
3
by: =?Utf-8?B?Z21wdXJwbGU=?= | last post by:
I am running Windows Vista. My clock runs 2 minutes slow. My clock is not set to sync with any Internet Time. I changed it to the correct time but upon reboot the time was reset. I went in the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.