c# - How to detect if CPU is 32 or 64 bit -


i want detect capabilities op cpu's (especially if 32/64 bit cpu)

the machines running on 32-bit os (winxp) , want detect if these machine capable 64 bit os installed.

(btw: @ point know how detect number of cores...)

you can use wmi more details each cpu, following properties available in win32_processor class

you can use following code value of each property :

managementobjectsearcher searcher = new managementobjectsearcher("root\\cimv2", "select * win32_processor"); managementobjectcollection cpus = searcher.get() foreach (managementobject queryobj in cpus) {     console.writeline("addresswidth : {0}", queryobj["addresswidth"]); //on 32-bit operating system, value 32 , on 64-bit operating system 64.     console.writeline("datawidth: {0}", queryobj["datawidth"]); //on 32-bit processor, value 32 , on 64-bit processor 64     console.writeline("architecture: {0}", queryobj["architecture"]); //processor architecture used platform } 

i'm not sure if addresswidth correct property need determine if cpu capable 64 bit os or not


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -