Can any one tell how to determine the time at which the windows pc is waked up from sleep? using C#.
I know how to get the time when the computer is powered on.
Can any one tell how to determine the time at which the windows pc is waked up from sleep? using C#.
I know how to get the time when the computer is powered on.
You can visit this site to detect when the pc wakes up or sleeps Also you can use the Stopwatch class to get the time.
private void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
{
switch (e.Mode)
{
// Cuando regresa del sleep
case PowerModes.Resume:
sleepStopwatch.Stop();
break;
// Cuando se va en sleep
case PowerModes.Suspend:
sleepStopwatch.Start();
break;
}
}