Using C#, I would like to create a method that retunrs whether my machine is 64 or 32-bit.
Is there anybody who knows how to do that?
You can check using IntPtr size. IntPtr size is 4 for 32 bit OS and 8 for 64 bit OS
/// Is64s the bit operating system.
///
if (IntPtr.Size == 8)
// 64Bit
else
// 32bit
Type: System.Int32
The size of a pointer or handle in this process, measured in bytes. The value of this property is 4 in a 32-bit process, and 8 in a 64-bit process. You can define the process type by setting the /platform
switch when you compile your code with the C#
and Visual Basic
compilers.