操作系统检测

asp函数

2008-06-11 10:31

function getsys()
'----------------------------------操作系统检测
vibo_soft=Request.ServerVariables("HTTP_USER_AGENT")
if instr(vibo_soft,"Windows NT 5.0") then
msm="Win 2000"
elseif instr(vibo_soft,"Windows NT 5.1") then
msm="Win XP"
elseif instr(vibo_soft,"Windows NT 5.2") then
msm="Win 2003"
elseif instr(vibo_soft,"4.0") then
msm="Win NT"
elseif instr(vibo_soft,"NT") then
msm="Win NT"
elseif instr(vibo_soft,"Windows CE") then
msm="Windows CE"
elseif instr(vibo_soft,"Windows 9") then
msm="Win 9x"
elseif instr(vibo_soft,"9x") then
msm="Windows ME"
elseif instr(vibo_soft,"98") then
msm="Windows 98"
elseif instr(vibo_soft,"Windows 95") then
msm="Windows 95"
elseif instr(vibo_soft,"Win32") then
msm="Win32"
elseif instr(vibo_soft,"unix") or instr(vibo_soft,"linux") or instr(vibo_soft,"SunOS") or instr(vibo_soft,"BSD") then
msm="类Unix"
elseif instr(vibo_soft,"Mac") then
msm="Mac"
else
msm="Other"
end if
getsys=msm
End Function