用C#code如何运行POWERCFG的功能呢?功能、code、POWERCFG

2023-09-06 23:03:58 作者:抹不掉的羁绊*

如何通过C#code运行POWERCFG功能? 比如我要运行这一点,设置关闭显示器:从不

  POWERCFG -CHANGE -monitor -timeout -ac 0
 

解决方案

的Process.Start

 的Process.Start(POWERCFG,-CHANGE -monitor -timeout -ac 0);
 

如何用vscode运行vue项目 vscode配置

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");