如何创建/插入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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法在 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.
现在它正在工作......请按照以下方式操作:
感谢您的帮助
Now it's working... follow bellow how I done it:
Thanks for your help