473,385 Members | 1,341 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,385 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 1219
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.