使用 WMI 提供程序无需安装 &海关总署注册

发布于 2024-10-08 13:04:38 字数 176 浏览 0 评论 0原文

我想创建一个 .NET 应用程序,只要该应用程序正在运行,它就会启用我的 WMI 提供程序,并在关闭时禁用它。

有办法做到这一点吗?

我的最后一招是安装和安装关闭时重新安装。

请注意,我是 WMI 方面的专家,所以拜托,您甚至可以发布最琐碎和平庸的答案。

I want to create a .NET application that will enable my WMI provider as long as the application is running, and disable it on closing.

Is there a way of doing that?

My last resort is install & reinstall on closing.

Note that I'm a n00b in the ways of the WMI, so please, you can post even the most trivial and banal answers.

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

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

发布评论

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

评论(1

花之痕靓丽 2024-10-15 13:04:38

我认为这是不可能的,因为 WMI 提供程序需要在 WMI 内注册(例如,拥有 __InstanceProviderRegistration 的实例)。要向其中添加 .NET 安装程序类型 DefaultManagementInstaller将需要操作WMI配置数据,这需要提升。 (本机应用程序通常会直接使用 MOF 格式文件,但这仍然需要将文件复制到受保护的系统文件夹。)

似乎没有进程内 WMI 提供程序的 .NET 4 示例,但有一个用于 . NET 3.5:http://msdn.microsoft.com/en -gb/library/bb885150(VS.90).aspx

I don't think it will be possible because a WMI provider needs to be registered within WMI (e.g. having an instance of __InstanceProviderRegistration). To add to these the .NET installer type DefaultManagementInstaller will need to manipulate the WMI configuration data, this requires elevation. (A native application would often use the MOF format file directly, but this still requires copying the file to a protected system folder.)

There appears to be no .NET 4 sample of an in-process WMI provider, but there is one for .NET 3.5: http://msdn.microsoft.com/en-gb/library/bb885150(VS.90).aspx

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