Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Recuperer l'uptime

2 réponses
Avatar
Delf
Comment récupérer l'uptime (ou une estimation) sous Windows en C# ?
Rien dans le MSDN :\
Merci.

--
Delf

2 réponses

Avatar
Jean-Marc Hilaire [MS]
PerformanceCounter pc = new PerformanceCounter("System", "System Up Time");

pc.NextValue();

TimeSpan ts = TimeSpan.FromSeconds(pc.NextValue() );

MessageBox.Show ("Uptime: " + ts.Days + " days, " + ts.Hours + " hours, " +

ts.Minutes + " minutes");



"Delf" wrote in message
news:423e7d87$0$21404$
Comment récupérer l'uptime (ou une estimation) sous Windows en C# ?
Rien dans le MSDN :
Merci.

--
Delf


Avatar
Delf
Jean-Marc Hilaire [MS] wrote:

> [...]

Merci bien :)

--
Delf