Quantcast
Channel: User BobbyShaftoe - Stack Overflow
Viewing all articles
Browse latest Browse all 45

Answer by BobbyShaftoe for How to detect Windows 64-bit platform with .NET?

$
0
0

Quickest way:

if(IntPtr.Size == 8) {    // 64 bit machine} else if(IntPtr.Size == 4)  {    // 32 bit machine} 

Note: this is very direct and works correctly on 64-bit only if the program does not force execution as a 32-bit process (e.g. through <Prefer32Bit>true</Prefer32Bit> in the project settings).


Viewing all articles
Browse latest Browse all 45

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>