drupal stats

Get system uptime using C#

September 15th, 2011 C# 0 Comments


string uptime = String.Empty;

uptime += (Environment.TickCount / 86400000).ToString() + " days, ";

uptime += (Environment.TickCount / 3600000 % 24) + " hours, ";

uptime += (Environment.TickCount / 120000 % 60) + " minutes, ";

uptime += (Environment.TickCount / 1000 % 60) + " seconds.";

MessageBox.Show(uptime);

Tags: c# system uptime, system uptime c#, C# system uptime in minutes, get windows uptime c#, get windows up time c#, get system uptime c#, get uptime from file c#, c# get windows uptime, system uptime in c#, environment tickcount to seconds c#

No related posts.

No Comments