لكي تحصل علي أسماء البرامج المثبته فقط

  Private Function GetInstalledApplicationNames() As List(Of String)
Dim result As List(Of String) = New List(Of String)()
Dim regKeyString As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

Using key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regKeyString)
If key IsNot Nothing Then
Dim names As String() = key.GetSubKeyNames()
Dim i As Integer = 0
While i < names.Length
Dim currentName As String = names(i)
Using subKey As Microsoft.Win32.RegistryKey = key.OpenSubKey(currentName)
Try
If subKey IsNot Nothing AndAlso subKey.GetValue("DisplayName") IsNot Nothing Then
Dim installedapplication As String = subKey.GetValue("DisplayName").ToString()
If Not result.Contains(installedapplication) Then
result.Add(installedapplication)
End If
End If
Catch ex As Exception
End Try
End Using
i += 1
End While
End If

End Using

Return result
End Function

Leave a Reply

Your email address will not be published. Required fields are marked *