如何在1台计算机上获取所有版本的已安装应用程序

时间:2018-09-12 04:23:04

标签: vb.net

当前,我正在使用Vb.net将所有版本的Adobe Reader安装在我的计算机上。但是我无法理解我的负责人给出的我在项目中看到的代码。

代码:

    TARGETKEY = "Software\Adobe\Acrobat Reader"
    strOutput() = NOTHING
    numkey = -1

    Private Function WMIsubkey(ByVal TARGETKEY As String, ByRef strOutput() As String, ByRef numKey As Integer) As Integer '0/-1
        Dim Service, Reg, Locator As Object
        Dim Subkey As Object = Nothing
        Dim i As Integer
        'Dim buf As String
        Locator = CreateObject("WbemScripting.SWbemLocator")
        Service = Locator.ConnectServer(vbNullString, "root\default")
        Reg = Service.Get("StdRegProv")
        Const HKEY_CURRENT_USER As Integer = &H80000001

        Reg.EnumKey(HKEY_CURRENT_USER, TARGETKEY, Subkey)
        For i = 0 To UBound(Subkey)
            numKey = numKey + 1
            ReDim Preserve strOutput(numKey)
            strOutput(numKey) = Subkey(i)
        Next i

        Reg = Nothing
        Service = Nothing
        Locator = Nothing
    End Function

在我的计算机上,我有一个Adobe Reader DC和Adobe Acrobat XI Pro。 我真的很想知道如何获取Adobe Reader的所有版本。有人可以为我提供有关如何获取Adobe Reader和Acrobat的所有版本的帮助吗?有人可以解释此代码如何返回Adobe Reader的版本吗?

在此先感谢您。

0 个答案:

没有答案
相关问题