gpt4 book ai didi

c# - 用 C# 确定 quicktime 版本

转载 作者:行者123 更新时间:2023-11-30 14:01:05 25 4
gpt4 key购买 nike

我正在编写一个 C# 应用程序,我需要确定系统上是否安装了 quicktime 及其版本。这是在 Windows 上。

最佳答案

Google 快速搜索显示了来自 this page 的以下代码:

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery _
("Select * From Win32_Product Where Name = 'QuickTime'")

If colItems.Count = 0 Then
Wscript.Echo "QuickTime is not installed on this computer."
Else
For Each objItem in colItems
Wscript.Echo "QuickTime version: " & objItem.Version
Next
End If

“但是等等!”你说,“那是 VBScript,不是 C#!”的确如此,但执行 WMI 查询的是 VBScript。另一个快速的谷歌搜索出现了how to do WMI queries from C# .

关于c# - 用 C# 确定 quicktime 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9041780/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com