如何创建/插入WMI对象吗? [英] How to create/insert WMI object?

查看:123
本文介绍了如何创建/插入WMI对象吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个管理在C#中的Windows电源计划,并得到了电源计划,并设置其设置的软件是由ManagementObjet容易。但是,我想创建一个新的电源计划,换句话说,创建一个新的WMI对象,我不知道该怎么做。

I'm doing a software that manages the Windows power plans in C#, and to get the Power Plans and set it's settings is easy by the ManagementObjet. But I want to create a new Power Plan, in other words, create a new WMI object, and I don't know how to do that.

是否有任何人知道如何建立呢?

Do any one knows how to create it?

推荐答案

您不能在WMI做到这一点。您可以使用Win32 API进行电源管理方案此处描述 的创建你的计划,然后监视/使用WMI管理。

You can't do this in WMI. You can use the Win32 APIs for Power Scheme Management as described here to create your plan, and then monitor/manage it using WMI.

要创建电源使用方案,则需要
先复制一个通过使用PowerDuplicateScheme
功能
,指定希望在立足新的
方案中的
计划的GUID现有的方案。您应该复制
内置方案之一,并修改
电源设置您的需求。

To create a power scheme, you need to first duplicate an existing scheme by using the PowerDuplicateScheme function, specifying the GUID of the scheme you wish to base your new scheme upon. You should copy one of the built-in schemes and modify the power settings to your needs.

这篇关于如何创建/插入WMI对象吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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