Copy Code code as follows:
Obtain client operating system (1:VISTA,2:WINDOWS7,3:2000,4:XP,5:2003,6:2008)
function Getosinfo () {
var _pf = Navigator.platform;
var appver = navigator.useragent;
if (_PF = = "Win32" | | _pf = = "Windows")
{
if (appVer.indexOf ("WOW64") >-1) {
_bit = "64 bits";
}else{
_bit = "32 bits";
}
if (appVer.indexOf ("Windows NT 6.0") >-1 | | | appver.indexof ("Windows Vista") >-1)
{
if (_bit== ' 64-bit ' | | | appver.indexof ("Windows Vista") >-1) {
Return ' Windows_vista ' +_bit;
}else{
return "Unknow1";
}
}else if (appVer.indexOf ("Windows NT 6.1") >-1 | | appver.indexof ("Windows 7") >-1) {
if (_bit== ' 32-bit ' | | | appver.indexof ("Windows 7") >-1) {
Return ' windows_7 ' +_bit;
}else{
return "Unknow";
}
}else {
try{
var _winname = Array (' Watts ', ' XP ', ' 2003 ');
var _ntnum = Appver.match (/windows NT 5.\d/i). toString ();
Return ' Windows_ ' + _winname[_ntnum.replace (/windows NT 5. ( \d)/I, "$"]+ "" +_bit;
}catch (e) {return ' Windows ';}
}
}else if (_PF = "mac68k" | | _pf = = "MACPPC" | | _pf = "Macintosh")
{
return "Mac";
}else if (_PF = = "X11")
{
return "Unix";
}else if (String (_PF). IndexOf ("Linux") >-1)
{
return "Linux";
}else
{
return "Unknow";
}
}