w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Unlogged out user if power failures/unplugging computer, how to handle power failures

Handling sudden power failures in an application running on the computer with the power failure simply isn't possible. When the power fails the computer will stop running and the application will receive no warning.

For cases where the power mode changes, as in computer being suspended or shut down, you can use the following events on SystemEvents

  • SystemEvents.PowerModeChanged
  • SystemEvents.SessionEnding

Both of these can be raised in response to specific power events on the computer. This may be what you are looking for





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.