作业系统版本 [英] operating system version

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

问题描述



如果操作系统为Win XP或更低,如何在操作系统之间进行比较,然后编写一些代码;如果操作系统为Win 7,则如何进行其他代码比较?

我知道有这样的平台::
my.computer.operating system name or platform .getinfo

但是第一个条件怎么办?

希望您能提供帮助:-O

Hi,

How can I compare between the operating system if it''s win XP or less, then do some code, else if its win 7 do another code?

I know there is platform like this::
my.computer.operating system name or platform .getinfo

But how to do the first condition?

I hope you can help :-O

推荐答案

使用 ^ ]检查您所使用的操作系统.

抱歉,CodeProject在我能够修改对 OperatingSystem [<一个href ="http://msdn.microsoft.com/zh-cn/library/system.operatingsystem.aspx" target ="_ blank" title ="New Window"> ^ ]类.
Use the Version Class[^] to check which OS you are on.

Sorry, CodeProject stopped responding before I was able to amend my answer to the OperatingSystem[^] class.


使用System.Environment类,属性Environment.OSVersion:

http://msdn.microsoft.com/en-us/library/system.environment.aspx [^ ]

http://msdn.microsoft.com/en-us/library/system.environment. osversion.aspx [ ^ ]

基本上,您可以这样做:

Use System.Environment class, the property Environment.OSVersion:

http://msdn.microsoft.com/en-us/library/system.environment.aspx[^]

http://msdn.microsoft.com/en-us/library/system.environment.osversion.aspx[^]

Basically, you do this:

System.OperatingSystem os = System.Environment.OSVersion;



并从os了解您的需求.



and learn what you need from os.


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

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