用C#code如何运行POWERCFG的功能呢? [英] How can run functions of powercfg by C# code?

查看:147
本文介绍了用C#code如何运行POWERCFG的功能呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过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");

这篇关于用C#code如何运行POWERCFG的功能呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆