Microsoft.Win32.SystemEvents.PowerModeChanged
event will give you this information. This event is available in all variants of the .NET framework released by Microsoft so far.
More Related Contents:
- sender as in C# [duplicate]
- CMD command on c#
- How can I update the current line in a C# Windows Console App?
- How to deal with files with a name longer than 259 characters?
- How to get Windows Display settings?
- How can I run another application within a panel of my C# program?
- How can I get the child windows of a window given its HWND?
- Detect active window changed using C# without polling
- Write to Windows Application Event Log without event source registration
- Programmatically add an application to Windows Firewall
- Enumerate windows like alt-tab does
- Is there Windows system event on active window changed?
- Which PID listens on a given port in c#
- “Invalid provider type specified” CryptographicException when trying to load private key of certificate
- How to interact with Windows Media Player in C#
- .NET FileInfo.LastWriteTime & FileInfo.LastAccessTime are wrong
- Change Language in C#
- Determine OS using Environment.OSVersion [duplicate]
- find all ip address in a network
- How can I display a system tray icon for C# window service.?
- Photo capture on Windows Store App for Windows Phone
- Start a windows service and launch cmd
- How to stop Windows service programmatically
- How to create a Process that outlives its parent
- Get list of local computer usernames in Windows
- How do I detect when a directory or file changes without constant scanning
- create local user account
- Install Windows Service created in Visual Studio
- Detect if non DPI-aware application has been scaled/virtualized
- How to know when was Windows started or shutdown?