示例#1
0
        public static PowerState GetPowerState()
        {
            PowerState state = new PowerState();
            if (GetSystemPowerStatusRef(state))
                return state;

            throw new ApplicationException("Unable to get power state");
        }
示例#2
0
 private static extern bool GetSystemPowerStatusRef(PowerState sps);