Sign In
Kris Stanton's WebLog
The things I learn working for the CLR team
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Blog Home
Email Blog Author
Share this
RSS for posts
Atom
RSS for comments
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
No tags have been created or used yet.
Archive
Archives
April 2004
(2)
March 2004
(2)
Simple way to check if you're on a 64-bit machine
MSDN Blogs
>
Kris Stanton's WebLog
>
Simple way to check if you're on a 64-bit machine
Simple way to check if you're on a 64-bit machine
MSDNArchive
20 Apr 2004 10:50 AM
Comments
6
In some of my tests, I need to check if I'm on a 64-bit machine or not. Yesterday, I spent some time looking through the System.Environment class or System.Diagnostics class to see if there was a static method or something that I could call to check if the machine I was on was a 64-bit machine. I was thinking to PInvoke to GetSystemInfo, but gosh darn it, there had to be an easier way! I talked to
Josh Williams
again (is it hard to tell we hang out?), and he said to just do a IntPtr.Size (static method) and since IntPtr is designed to be an integer whose size is platform specific, it will be 8 if you are on a 64-bit machine and 4 if you are on a 32-bit machine. Duh! I was so amazed at how simple this was that I wanted to share it with y'all...
6 Comments
Blog - Comment List MSDN TechNet
Comments
Loading...