Este o modalitate bună de a determina sistemul de operare al sistemului de operare?
Deoarece clasa WMI Win32_OperatingSystem include doar OSArchitecture în Windows Vista, am scris rapid o metodă care folosește registrul pentru a încerca să determine dacă sistemul actual este sau nu sistem de 32 sau 64 de biți.
Update: I'd take issue with checking for 'x86'. Who's to say what intel's or AMD's next 32 bit processor may be designated as. The probability is low but it is a risk. You should ask the OS to determine this via the correct API's, not by querying what could be a OS version/platform specific value that may be considered opaque to the outside world. Ask yourself the questions, 1 - is the registry entry concerned properly documented by MS, 2 - If it is do they provide a definitive list of possible values that is guaranteed to permit you as a developer to make the informed decision between whether you are running 32 bit or 64 bit. If the answer is no, then call the API's, yeah it's a but more long winded but it is documented and definitive.