无法在 WMI win32_product 表中找到 Flash Player
为什么 Macromedia Flash Player 没有出现在 WMI win32_product 表中? Flash Player 安装在我执行查询的计算机上。
我正在尝试执行以下查询:
Select * From win32_product where name like '%Flash%'
是否有其他方法可以获取任何已安装的 Flash Player 的版本。该项目是用C#开发的。
How come the Macromedia Flash Player isn't present in the WMI win32_product table? The Flash Player is installed on the machine where I'm executing the query.
I'm trying to execute the following query:
Select * From win32_product where name like '%Flash%'
Is there any other way to get the version of any installed Flash Player. This project is developed in C#.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Win32_Product
类仅代表由 Windows 安装程序。看来 Flash Player 使用了其他安装服务。以下是确定 Flash Player ActiveX 控件(适用于 IE 的 Flash Player)是否存在及其版本的方法:
System.Type
与ShockwaveFlash.ShockwaveFlash
ProgID 对应的对象。如果无法获取,则说明 Flash Player 未安装。如果成功,请转至步骤2。Type
对象的实例。GetVariable
方法。这将为您提供 Flash Player 版本字符串,格式为“操作系统主要、次要、发行版、内部版本”,例如“WIN 10,0,22,87”。像这样的东西(免责声明:我不太了解 C#,所以这段代码可能很蹩脚):
请注意,这种方法要求您为 x86 平台构建应用程序,因为 Flash Player 目前是仅限 32 位,您无法通过 64 位代码与其 ActiveX 对象交互。
The
Win32_Product
class only represents products that are installed by Windows Installer. Looks like Flash Player uses another installation service.Here's how you can determine the existence and version of the Flash Player ActiveX control (Flash Player for IE):
System.Type
object corresponding to theShockwaveFlash.ShockwaveFlash
ProgID. If you fail to get it, then the Flash Player is not installed. If you succeed, go to step 2.Type
object.GetVariable
method of the obtained object with the "$version" parameter. This will give you the Flash Player version string in the form "OS major,minor,release,build", e.g. "WIN 10,0,22,87".Something like this (Disclaimer: I don't know C# well, so this code may be lame):
Note that this approach requires that you build your application for the x86 platform, since the Flash Player is currently 32-bit only and you cannot interact with its ActiveX object from 64-bit code.