tags:

views:

68

answers:

3

Hi,

How to detect when the laptop is running on batteries (or AC) in .NET?

Thanks, Mahesh

A: 

For Vista and up, you can use WindowsAPICodecPack (PowerManager.PowerSourceChanged)

Igor