get current platform (x86, x64)

  • Thread starter Thread starter Frank Uray
  • Start date Start date
F

Frank Uray

Hi all

I am using "Any CPU" within my assemblies.
Is there a way to find out which platform is used ?
I like to know where the assembly is running on (x86, x64) ...

Thanks for any comments
and best regards
Frank Uray
 
Family said:
The size of IntPtr will be 8 under x64, and 4 under x86.

Console.WriteLine(IntPtr.Size == 4 ? "x86" : "x64");

Assuming that it is 32/64 bit of the CLR and not of Windows, then
that must be the easiest.

Arne
 
Back
Top