How to detect Windows 64 bit platform with .net?
Posted
by Marc
on Stack Overflow
See other posts from Stack Overflow
or by Marc
Published on 2008-12-03T09:32:38Z
Indexed on
2010/04/22
13:43 UTC
Read the original article
Hit count: 278
In a .net 2.0 C# application I use the following code to detect the operating system platform:
string os_platform = System.Environment.OSVersion.Platform.ToString();<br/>
This returns "Win32NT".
The problem is that it returns "Win32NT" even when running on Windows Vista 64bit.
Is there any other method to know the correct platform (32 or 64bit)?
Note that it should also detect 64bit when run as 32bit app on Windows 64bit.
© Stack Overflow or respective owner