Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Home » Tip Bank » .NET » C#
Language: .NET
Expertise: Beginner
May 11, 2017

Testing for 64 Bit or 32 Bit in a C# Application

A quick and dirty way to see if the application's current platform is 64 Bit or 32 Bit is to test the size of the System.IntPtr variable, as shown in the following example:

if (System.IntPtr.Size == 8) 
{ 
    // 64-bit 
} 
else 
{ 
    // 32-bit 
}
Hannes du Preez
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date