locked
How to get the Architecture of OS (32 bits or 64 bits) from Metro Style App

    Question

  • Hi All,

    I want to send the OS device profile bitness ( 32 bits or 64 bits )  to a Web Service as part of a request. Basically, I am looking for a API to get the platform of the OS. I found System.IntPtr.Size API and it can be used to get the platform:  MS's doc said: The value of this property is 4 on a 32-bit platform, and 8 on a 64-bit platform. http://msdn.microsoft.com/en-us/library/system.intptr.size(v=vs.71)

    If don't, Could I use  window.navigator.platform and the window.navigator.cpuClass  from my Metro Style App  (The UI of  my metro app is developed in Javascript).

    Could you please confirm if MS allows me using either of these mechanism from my Metro app to get platform value ?

    Thanks,

    Hugo,

    Wednesday, June 27, 2012 4:53 PM

Answers

  • Ok, Thanks for clarifying me the concept.


    • Marked as answer by Hugo Villalba Thursday, June 28, 2012 4:58 PM
    Thursday, June 28, 2012 4:58 PM

All replies

  • The size of the System.IntPtr will tell the bitness of the application, but not necessarily the platform. A 32-bit application can run on a 64-bit platform and IntPtr will be 4 bytes. I believe that window.navigator.platform and cpuClass will both have the same issue: they will tell if the host application is 32-bit or 64-bit, but not if the OS is 32-bit or 64-bit.

    Depending on your specific circumstances that may be sufficient, so long as you can avoid running in 32-bit on 64-bit OSes.

    --Rob

    Wednesday, June 27, 2012 7:31 PM
    Owner
  • Ok, Thanks for clarifying me the concept.


    • Marked as answer by Hugo Villalba Thursday, June 28, 2012 4:58 PM
    Thursday, June 28, 2012 4:58 PM