.NET - 从code设置电源选项 [英] .NET - setting power options from code

查看:137
本文介绍了.NET - 从code设置电源选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从C#写的很简单,code - 一个简单的2个按钮的应用程序,将让我改变了拍摄当盖子被关闭的操作。 从睡眠,以不采取行动,反之亦然。

I'd like to write very simple code from C# - a simple 2 button app that will allow me to change the action that is taken when the lid is closed. From "sleep" to "no action" and vice versa.

我发现它在某种程度上连接到WMI - 但对如何实现这一目标没有实际的信息

I found that it somehow connected to WMI - but no actual info on how achieving this.

帮助将非常AP preciated。

help would be much appreciated.

谢谢!

推荐答案

看看的的 Windows API的code包,这是周围很多Windows的API的包装。它包括电源管理API

Take a look at the Windows API Code Pack, which is a wrapper around a lot of the Windows APIs. It includes the Power Management API.

这篇关于.NET - 从code设置电源选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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