如何通过C#code运行POWERCFG功能? 比如我要运行这一点,设置关闭显示器:从不
POWERCFG -CHANGE -monitor -timeout -ac 0
解决方案
与 的Process.Start
:
的Process.Start(POWERCFG,-CHANGE -monitor -timeout -ac 0);
how can run functions of powercfg by c# code? for example I want to run this, for Set turn off the display: never
powercfg -CHANGE -monitor -timeout -ac 0
解决方案
Call it with Process.Start
:
Process.Start("powercfg", "-CHANGE -monitor -timeout -ac 0");