开发者

How can I get system type by c# code?

How can I get system type by c# 开发者_如何学运维code? for example: 32 bit. (win 7 Ent)


Environment.Is64BitOperatingSystem
Environment.Is64BitProcess
Enviromment.OSVersion

And for OSVersion look in this for constructing OS name - OS version realations: Determine OS using Environment.OSVersion

and this contains the different OS name, OS version relations:

http://www.nirmaltv.com/2009/08/17/windows-os-version-numbers/

Lastly, if you don't want to do all that code yourself, you could use this code (which will get you edition etc. but is not based on Environment):

http://www.csharp411.com/determine-windows-version-and-edition-with-c/


Checkout the IntPtr.Size property:

The value of this property is 4 on a 32-bit platform, and 8 on a 64-bit platform.


You can use:

System.OperatingSystem info = System.Environment.OSVersion;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜