Home > C#, Code Snippets, DOTNET > Is your windows is 32 or 64 bit?

Is your windows is 32 or 64 bit?

Here is a simple method in .NET to detect whether your OS is 32 bit or 64bit.

int size = Marshal.SizeOf(typeof(IntPtr));
if (size == 8)
{
 Text = "64 bit";
}
else if (size == 4)
{
 Text = "32 bit";
}

Namespace: System.Runtime.InteropServices

VN:F [1.9.18_1163]
Rating: 5.0/5 (1 vote cast)
Is your windows is 32 or 64 bit?, 5.0 out of 5 based on 1 rating

No related posts.

Categories: C#, Code Snippets, DOTNET