Under Win7, open Control Panel -> Power Options -> Advanced Settings->Processor power management.
you can see Minimum Processor state, Maximum Processor state. I have get the value by powercfg command using C#. Now,I want to set the value of Processor state by C#. For example the old value is 5%,execute the programe,update the value to 10%. I have search the powercfg help document,there are no such command to do this.
How can I achieve this?
I could only recommend calling WriteProcessorPwrScheme using PInvoke. Windows API Code Pack for .NET has some power management functions but probably not this one.
use
PowerWriteACValueIndex()/PowerWriteDCValueIndex()
1st parameter is NULL, 2nd parameter -- GUID for desired power scheme (GUID_MAX_POWER_SAVINGS/GUID_MIN_POWER_SAVINGS/GUID_TYPICAL_POWER_SAVINGS), 3rd parameter -- GUID_PROCESSOR_SETTINGS_SUBGROUP, 4th parameter -- GUID_PROCESSOR_THROTTLE_MAXIMUM or GUID_PROCESSOR_THROTTLE_MINIMUM
all the GUID description could be found in winnt.h
来源:https://stackoverflow.com/questions/13617914/how-can-i-set-the-value-of-minimum-maximum-processor-state