Getting the Windows Product ID using WMI
I needed to get the Windows Product ID from managed code recently and decided that using WMI would be the most reliable and stable way to get the job done. Do not follow any examples that show you how to get this information from the registry. You simply cannot rely on those registry keys being present in the many different versions of Windows. There is also no guarantee that if they are present, that this will continue to be the case into the future. Using an official and supported API means that maintaining compatibility is Microsoft’s problem and not yours.
autofac (26) web-services (23) wscf (15) links (10) mvc (6) tools (6) c# (5) blogengine-net (5) resharper (5) sql-server (4) rest (4) windows (3) httpclient (3) windows-live-writer (3) visual-studio (2) tfs (2) silverlight (2) velocity (2) service-fabric (1) net-core (1) asp-net (1) dnx (1) web-api (1) linq (1) mongodb (1) wmi (1) codedom (1) nunit (1) reflector (1) -net-framework (1) lightspeed (1) sqlite (1) -net-ria-services (1) feedburner (1) jquery (1)