
Originally Posted by
Half
Code:
MessageBox.Show(System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"))
should work too but I only have 32bit XP and can't test it. Wouldn't the IntPtr size be informative too? It shows 32 here, which is to be expected in my case.
I was under the impression that that code would provide information about the processor itself rather than the OS, but I just ran it on 32-bit Windows running on a 64-bit processor and got "x86" as the result. I have also read suggestions for using the fact that the size of an IntPtr will be 4 on 32-bit systems and 8 on 64-bit systems, which you would exploit like so:
vb.net Code:
Runtime.InteropServices.Marshal.SizeOf(GetType(IntPtr))