Windows版本在C# [英] Windows version in c#

查看:256
本文介绍了Windows版本在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道哪个Windows版本的电脑有...在C#框架3.5

I want to know which Windows version the PC has.. in C# Framework 3.5

我曾试过用

OperatingSystem的OS = Environment.OSVersion;

OperatingSystem os = Environment.OSVersion;

版本版本= os.Version;

Version ver = os.Version;

但结果是

Plataform:WIN32NT

Plataform: WIN32NT

6.2.9200版本

version 6.2.9200

版本次要:2

主要版本:6

现在的问题是,我有的Windows 8专业版......

The problem is that I have "Windows 8 Pro"...

我如何检测呢?

感谢

推荐答案

您必须匹配的版本号与适当的字符串值自己。

You will have to match version numbers with the appropriate string value yourself.

下面是最新的Windows操作系统和其相应的版本号的列表:

Here is a list of the most recent Windows OS and their corresponding version number:

  • 视窗10 - 10.0 *
  • 的Windows Server技术preVIEW - 10.0 *
  • 的Windows 8.1 - 6.3 *
  • 在Windows Server 2012中R2 - 6.3 *
  • 在Windows 8中 - 6.2
  • 在Windows Server 2012中 - 6.2
  • 在Windows 7中 - 6.1
  • 在Windows Server 2008 R2 - 6.1
  • 在Windows Server 2008中 - 6.0
  • 在Windows Vista中 - 6.0
  • 在Windows Server 2003 R2 - 5.2
  • 在Windows Server 2003中 - 5.2
  • 在Windows XP的64位版本 - 5.2
  • 在Windows XP中 - 5.1
  • 在Windows 2000中 - 5.0
  • Windows 10 - 10.0*
  • Windows Server Technical Preview - 10.0*
  • Windows 8.1 - 6.3*
  • Windows Server 2012 R2 - 6.3*
  • Windows 8 - 6.2
  • Windows Server 2012 - 6.2
  • Windows 7 - 6.1
  • Windows Server 2008 R2 - 6.1
  • Windows Server 2008 - 6.0
  • Windows Vista - 6.0
  • Windows Server 2003 R2 - 5.2
  • Windows Server 2003 - 5.2
  • Windows XP 64-Bit Edition - 5.2
  • Windows XP - 5.1
  • Windows 2000 - 5.0

*对于已经表现为Windows 8.1或10应用程序不表现为8.1 / 10将返回Windows 8的操作系统版本值(6.2)的应用程序。

*For applications that have been manifested for Windows 8.1 or 10. Applications not manifested for 8.1 / 10 will return the Windows 8 OS version value (6.2).

这里的源

另外,从相同的源:

确定当前的操作系统通常不是最好的方法   确定一个特定的操作系统功能是否present。   这是因为操作系统可能已经添加了新功能   在再发行的DLL。而不是使用版的API助手   函数来确定操作系统平台或版本   数,测试特征本身的presence。

Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using the Version API Helper functions to determine the operating system platform or version number, test for the presence of the feature itself.

这篇关于Windows版本在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆