c# - .NET Find Windows Sleep Settings -
i find out current windows sleep mode setting i.e. switched on , timer period. ideas?
my preferences (in order) are:
- .net managed code
- api
- read registry value
here stored in registry:
[hkey_current_user\control panel\powercfg] "currentpowerpolicy"="2" power scheme (default="0") "0" = home/office desk "1" = portable/laptop "2" = presentation "3" = on "4" = minimal power management "5" = max battery
then access it:
registrykey key= registry.currentuser.opensubkey("control panel\powercfg", true); var value = key.getvalue("currentpowerpolicy", 0);
there key called policies reg_binary
stores specific information. can use example on page read it: http://www.eggheadcafe.com/community/aspnet/2/13312/registry-access-for-regbinary-values.aspx
Comments
Post a Comment