WMI 和C#可以一起玩吗?

发布于 2024-09-26 05:58:43 字数 139 浏览 0 评论 0原文

我已经看到了 WMI 的用处。

我的问题是,所有 WMI API 是否都可以与 C# 等 .net 语言一起使用,还是只能通过 c++ 和脚本启用?你知道我在哪里可以找到相关信息吗?

我只能找到几个例子。

非常感谢。

I have seen the usefull that WMI can be.

My question, is all WMI API enable to use with a .net language like C#, or is it only through c++ and Scripting enable? Do you know where Can I find information about.

I could only find a few examples.

Thank you a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

哦主啊,不。 WMI 在 C++ 中非常痛苦,System.Management 是您必须用 C++ 编写的 COM 代码的一个非常好的包装器。您甚至不必自己编写 C# 代码。下载 WMI 代码创建器工具,它允许您使用查询,并自动生成 C# 代码以剪切并粘贴到您的项目中。

Oh Lord, no. WMI is farking painful in C++, System.Management is a very nice wrapper around the COM code you'd have to write in C++. You don't even have to write the C# code yourself. Download the WMI Code Creator Tool, it lets you play with the queries and it automatically generates the C# code to cut-and-paste into your project.

两人的回忆 2024-10-03 05:58:43

查看 System.Management 命名空间。

Have a look at the classes in the System.Management namespace.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文