Get installed applications in a system

后端 未结 14 993
遥遥无期
遥遥无期 2020-11-22 08:28

How to get the applications installed in the system using c# code?

14条回答
  •  清酒与你
    2020-11-22 09:20

    Might I suggest you take a look at WMI (Windows Management Instrumentation). If you add the System.Management reference to your C# project, you'll gain access to the class `ManagementObjectSearcher', which you will probably find useful.

    There are various WMI Classes for Installed Applications, but if it was installed with Windows Installer, then the Win32_Product class is probably best suited to you.

    ManagementObjectSearcher s = new ManagementObjectSearcher("SELECT * FROM Win32_Product");
    

提交回复
热议问题