Is there a unique identifier for the application running on Windows?

I am developing a desktop application using C # to keep track of applications running on windows. Is this any unique number for each application that is installed in windows?

I can get the handle number, but the handle number changes when the app is reopened.

I need a unique ID for each application installed on Windows.

+3


source to share


1 answer


Use the WMI System.Management API. I think you need an IdentifyingNumber which will give you the GUID for the product.



    ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_Product");
    foreach (ManagementObject mo in mos.Get())
    {
        Console.WriteLine(mo["Name"]);
        foreach (PropertyData prop in mo.Properties)
        {
            Console.WriteLine("{0}: {1}", prop.Name, prop.Value);
        }
    }

      

0


source







All Articles