Asp超精准判断客户端操作系统类型代码
分类:程序开发 Tags: asp 操作系统 评论:0 浏览:4234 最近更新时间:2014/8/23 13:34:38
以下是Asp判断客户端操作系统源码,支持自定义关键词,支持“<img”方式调用:
<%
Function GetSysVer() '获取系统类型(可以判断:29种操作系统(包括手机))
GetSysVer="Other Unknown"
TheInfo = UCase(Request.ServerVariables("HTTP_USER_AGENT"))
if Instr(TheInfo,UCase("x11"))>0 or Instr(TheInfo,UCase("Unix"))>0 then GetSysVer="Unix"
if Instr(TheInfo,UCase("Sunos"))>0 or Instr(TheInfo,UCase("SUN OS"))>0 then GetSysVer="SUN OS"
if Instr(TheInfo,UCase("PowerPC"))>0 or Instr(TheInfo,UCase("PPC"))>0 then GetSysVer="PowerPC"
if Instr(TheInfo,UCase("Macintosh"))>0 then GetSysVer="Mac"
if Instr(TheInfo,UCase("Mac OSX"))>0 then GetSysVer="MacOSX"
if Instr(TheInfo,UCase("FreeBSD"))>0 then GetSysVer="FreeBSD"
if Instr(TheInfo,UCase("Linux"))>0 then GetSysVer="Linux"
if Instr(TheInfo,UCase("Palmsource"))>0 or Instr(TheInfo,UCase("PalmOS"))>0 then GetSysVer="PalmOS"
if Instr(TheInfo,UCase("WAP"))>0 then GetSysVer="WAP Mobile Phone"
if Instr(TheInfo,UCase("Win98"))>0 then GetSysVer="Win 98"
if Instr(TheInfo,UCase("NOKIAN"))>0 then GetSysVer="NOKIAN(诺基亚手机)"
if Instr(TheInfo,UCase("Media Center"))>0 then GetSysVer="Windows XP Media Center PC"
if Instr(TheInfo,UCase("Windows"))>0 then
GetSysVer="Windows Series"
if Instr(TheInfo,UCase("Windows CE"))>0 then GetSysVer="Windows CE"
if Instr(TheInfo,UCase("Windows 95"))>0 then GetSysVer="Windows 95"
if Instr(TheInfo,UCase("Windows 98"))>0 then GetSysVer="Windows 98"
if Instr(TheInfo,UCase("Windows 2000"))>0 then GetSysVer="Windows 2000"
if Instr(TheInfo,UCase("Windows XP"))>0 then GetSysVer="Windows XP"
if Instr(TheInfo,UCase("Windows NT"))>0 then
GetSysVer="Windows NT Series"
if Instr(TheInfo,UCase("Windows NT 4.0"))>0 then GetSysVer="Windows 9x/98/95"
if Instr(TheInfo,UCase("Windows NT 5.0"))>0 then GetSysVer="Windows 2000"
if Instr(TheInfo,UCase("Windows NT 5.1"))>0 then GetSysVer="Windows XP"
if Instr(TheInfo,UCase("Windows NT 5.2"))>0 then GetSysVer="Windows Server 2003"
if Instr(TheInfo,UCase("Windows NT 6.0"))>0 then GetSysVer="Windows Vista/Windows Server 2008"
if Instr(TheInfo,UCase("Windows NT 6.1"))>0 then GetSysVer="Windows Server 2008 R2/Windows 7 Series"
end if
end if
if Instr(TheInfo,UCase("Tablet PC"))>0 then GetSysVer=GetSysVer & "-Tablet PC(平板电脑)"
if Instr(TheInfo,UCase("Jakarta Commons"))>0 then GetSysVer=GetSysVer & "-Jakarta Commons-HttpClient"
if Instr(TheInfo,UCase("bsalsa.com"))>0 then GetSysVer=GetSysVer & "-[BOT]bsalsa.com(搜索引型)"
End Function
Response.Write GetSysVer
%>
转载自:http://lcx.cc/?i=481
本文地址:/515/
-
• asp导出excel文件方法
• ASP网页过滤HTML代码的多种方法
• 一个表单中如何实现多个按钮提交的方法代码
• 通用ASP生成HTML代码,无需读取模版
• asp检测email地址是否有效函数
• 把Access 2010 .accdb文件格式转换为Access 2003 .mdb操作方法
• 兼容ie,火狐,chrome,safari,360,qq,遨游,搜狗等浏览器的设为首页和加入收藏代码
• 利用ASP显示当前网站在线人数代码
• fckeditor报错FCKLang undefined(fcklang未定义)的解决方法
• windows 2003通过squid搭建cdn节点加速服务