JavaScript操作系统检测 - 几个Windows XP版本? [英] JavaScript OS Detection - several Windows XP versions?

查看:181
本文介绍了JavaScript操作系统检测 - 几个Windows XP版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图检测三个操作系统 - Windows XP,Windows Vista,Linux。

我使用navigator.oscpu警告以下操作系统/值 -

/ p>

  Windows XP SP3  -  Windows NT 5.1 

Windows Vista - Windows NT 6.0

Ubuntu 9.04 - Linux i686

我对XP显示的数字5.1感到怀疑。它会显示5.1的所有配置或XP - (无SP2,SP2,SP3)?

是否有机会显示Windows NT 5.0 XP在SP2之前或SP3之前的配置?

底线是 - Windows XP是平均5.1还是任何5.x版本?



如果有更好的方式来明确区分三种操作系统,那将是非常棒的。

注意:这是一个Firefox延期。所以,JavaScript代码的跨浏览器兼容性不是问题。请不要带上这个在IE中不起作用的东西。

解决方案

XP的32位,任何服务包。

  Windows 2000:5.0 
Windows XP:5.1
Windows XP 64位:5.2
Windows Vista:6.0
Windows 7:6.1

这里有一个包含所有版本号的表: Microsoft Windows /发布时间表

I am trying to detect three operating systems - Windows XP, Windows Vista, Linux.

I use the navigator.oscpu which alerts the following OS/values -

Windows XP SP3 - Windows NT 5.1

Windows Vista - Windows NT 6.0

Ubuntu 9.04 - Linux i686

I am doubtful about the number 5.1 shown for XP. Will it show 5.1 for ALL configurations or XP - (without SP2, With SP2, With SP3) ??

Is there any chance for it to show Windows NT 5.0 for Windows XP in pre-SP2 or pre-SP3 configurations?

Bottom line is - does Windows XP mean 5.1 only or any 5.x version?

If there is a better way to definitively distinguish between the three operating systems, it will be great.

Note: This is for a Firefox extension. So, cross browser compatibility of the JavaScript code is not an issue. Please don't bring up this won't work in IE stuff.

解决方案

Windows 5.1 is XP 32-bit, for any service pack.

Windows 2000:      5.0
Windows XP:        5.1
Windows XP 64-bit: 5.2
Windows Vista:     6.0
Windows 7:         6.1

There's a table of all the version numbers here: Microsoft Windows / Timeline of releases

这篇关于JavaScript操作系统检测 - 几个Windows XP版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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