You can just check the static Size property on the IntPtr class.
Hope this helps.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
>I would imagine that you could just take the size of a reference (if 4
>bytes = 32 if 8 bytes = 64) although there might be a method somewhere that
[quoted text clipped - 7 lines]
>>
>> -Martijn
Martijn Boven - 21 Aug 2006 15:18 GMT
That's smart. Thanks for the answer.
Greetings,
Martijn
> You can just check the static Size property on the IntPtr class.
>
[quoted text clipped - 11 lines]
>>>
>>> -Martijn
Martijn Boven - 21 Aug 2006 15:26 GMT
btw this code works fine:
public static bool Is64BitMode()
{
return System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr))
== 8;
}
> That's smart. Thanks for the answer.
>
[quoted text clipped - 16 lines]
>>>>
>>>> -Martijn