Sep 03
It’s easy to determine if your C# application is 64-bit. Just check the Size property of IntPtr. If it’s 8, then your application is 64-bit. If it’s 4, then your application is 32-bit.
Here is a simple C# console program to demonstrate this:
using System;
namespace CSharp411
{
class Program
{
static void Main( string[] args )
{
int bits = IntPtr.Size * 8;
Console.WriteLine( "{0}-bit", bits );
Console.ReadLine();
}
}
}
Copyright © 2007-8 Tiwebb Ltd. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without explicit permission from Tiwebb Ltd.


And there is no way that this might go wrong somehow?
I suppose anything can go wrong with software.
But I tested this with a 32-bit app on x86 and x64, and a 64-bit app on x64.
It should work in all cases (including when we go to 128-bit, if that happens in our lifetime) because the application “bit-ness” determines the size of the pointers.
Good Tip!
Very useful
Hi, I found your blog on this new directory of WordPress Blogs at blackhatbootcamp.com/listofwordpressblogs. I dont know how your blog came up, must have been a typo, i duno. Anyways, I just clicked it and here I am. Your blog looks good. Have a nice day. James.
This is exactly what I was looking for. Thanks bro!