ASP Request.ServerVariables(HTTP_USER_AGENT)获取客户端浏览者的操作系统类型,可获取到UNIX、WIN95——WIN XP之间的操作系统类型,还可以判断出是否是Telport、offline、webzip等类型。
Function GetSystem() info=Request.ServerVariables(HTTP_USER_AGENT) if Instr(info,"NT 5.1")>0 then system="Windows XP" elseif Instr(info,"Tel")>0 then system="Telport" elseif Instr(info,"webzip")>0 then system="webzip" elseif Instr(info,"flashget")>0 then system="flashget" elseif Instr(info,"offline")>0 then system="offline" elseif Instr(info,"NT 5")>0 then system="Windows 2000" elseif Instr(info,"NT 4")>0 then system="Windows NT4" elseif Instr(info,"98")>0 then system="Windows 98" elseif Instr(info,"95")>0 then system="Windows 95" elseif instr(info,"unix") or instr(info,"linux") or instr(info,"SunOS") or instr(info,"BSD") then system="Unix类操作系统" elseif instr(thesoft,"Mac") then system="Mac" else system="其它操作系统" end if End Function
本函数调用无需参数,需要的时候只需<=%GetSystem()%>即可,或者将其赋值给一个ASP的变量,如<%=GetSystem()%>
吉公网安备 22020202000301号