Asp超精准判断客户端浏览器类型代码
分类:程序开发 Tags: asp 浏览器 评论:0 浏览:4832 最近更新时间:2014/8/23 13:35:55
以下是Asp判断客户端浏览器类型源码,支持自定义关键词,支持“<img”方式调用:
<% Function GetBrType() '获取浏览器类型(可以判断:47种浏览器;GoogLe,Grub,MSN,Yahoo!蜘蛛;十种常见IE插件) Dim StrType, TheInfo, Tmp1, Sysver GetBrType = "Other Unknown" TheInfo = UCase(Request.ServerVariables("HTTP_USER_AGENT")) if Instr(TheInfo,UCase("mozilla"))>0 then GetBrType = "Mozilla" if Instr(TheInfo,UCase("icab"))>0 then GetBrType = "iCab" if Instr(TheInfo,UCase("lynx"))>0 then GetBrType = "Lynx" if Instr(TheInfo,UCase("links"))>0 then GetBrType = "Links" if Instr(TheInfo,UCase("elinks"))>0 then GetBrType = "ELinks" if Instr(TheInfo,UCase("jbrowser"))>0 then GetBrType = "JBrowser" if Instr(TheInfo,UCase("konqueror"))>0 then GetBrType = "konqueror" if Instr(TheInfo,UCase("wget"))>0 then GetBrType = "wget" if Instr(TheInfo,UCase("ask jeeves"))>0 or Instr(TheInfo,UCase("teoma"))>0 then GetBrType = "Ask Jeeves/Teoma" if Instr(TheInfo,UCase("wget"))>0 then GetBrType = "wget" if Instr(TheInfo,UCase("opera"))>0 then GetBrType = "opera" if Instr(TheInfo,UCase("NOKIAN"))>0 then GetBrType = "NOKIAN(诺基亚手机)" if Instr(TheInfo,UCase("SPV"))>0 then GetBrType = "SPV(多普达手机)" if Instr(TheInfo,UCase("Jakarta Commons"))>0 then GetBrType = "Jakarta Commons-HttpClient" if Instr(TheInfo,UCase("Gecko"))>0 then StrType = "[Gecko] " GetBrType = "Mozilla Series" if Instr(TheInfo,UCase("aol"))>0 then GetBrType = "AOL" if Instr(TheInfo,UCase("netscape"))>0 then GetBrType = "Netscape" if Instr(TheInfo,UCase("firefox"))>0 then GetBrType = "FireFox" if Instr(TheInfo,UCase("chimera"))>0 then GetBrType = "Chimera" if Instr(TheInfo,UCase("camino"))>0 then GetBrType = "Camino" if Instr(TheInfo,UCase("galeon"))>0 then GetBrType = "Galeon" if Instr(TheInfo,UCase("k-meleon"))>0 then GetBrType = "K-Meleon" GetBrType = StrType & GetBrType end if if Instr(TheInfo,UCase("bot"))>0 or Instr(TheInfo,UCase("crawl"))>0 then StrType = "[Bot/Crawler]" if Instr(TheInfo,UCase("grub"))>0 then GetBrType = "Grub" if Instr(TheInfo,UCase("googlebot"))>0 then GetBrType = "GoogleBot" if Instr(TheInfo,UCase("msnbot"))>0 then GetBrType = "MSN Bot" if Instr(TheInfo,UCase("slurp"))>0 then GetBrType = "Yahoo! Slurp" GetBrType = StrType & GetBrType end if if Instr(TheInfo,UCase("applewebkit"))>0 then StrType = "[AppleWebKit]" GetBrType = "" if Instr(TheInfo,UCase("omniweb"))>0 then GetBrType = "OmniWeb" if Instr(TheInfo,UCase("safari"))>0 then GetBrType = "Safari" GetBrType = StrType & GetBrType end if if Instr(TheInfo,UCase("msie"))>0 then StrType = "[MSIE" Tmp1 = mid(TheInfo,(Instr(TheInfo,UCase("MSIE"))+4),6) Tmp1 = left(Tmp1,Instr(Tmp1,";")-1) StrType = StrType & Tmp1 & "]" GetBrType = "Internet Explorer" GetBrType = StrType & GetBrType end if if Instr(TheInfo,UCase("msn"))>0 then GetBrType = "MSN" if Instr(TheInfo,UCase("aol"))>0 then GetBrType = "AOL" if Instr(TheInfo,UCase("webtv"))>0 then GetBrType = "WebTV" if Instr(TheInfo,UCase("myie2"))>0 then GetBrType = "MyIE2" if Instr(TheInfo,UCase("maxthon"))>0 then GetBrType = "Maxthon(傲游浏览器)" if Instr(TheInfo,UCase("gosurf"))>0 then GetBrType = "GoSurf(冲浪高手浏览器)" if Instr(TheInfo,UCase("netcaptor"))>0 then GetBrType = "NetCaptor" if Instr(TheInfo,UCase("sleipnir"))>0 then GetBrType = "Sleipnir" if Instr(TheInfo,UCase("avant browser"))>0 then GetBrType = "AvantBrowser" if Instr(TheInfo,UCase("greenbrowser"))>0 then GetBrType = "GreenBrowser" if Instr(TheInfo,UCase("slimbrowser"))>0 then GetBrType = "SlimBrowser" if Instr(TheInfo,UCase("360SE"))>0 then GetBrType = GetBrType & "-360SE(360安全浏览器)" if Instr(TheInfo,UCase("QQDownload"))>0 then GetBrType = GetBrType & "-QQDownload(QQ下载器)" if Instr(TheInfo,UCase("TheWorld"))>0 then GetBrType = GetBrType & "-TheWorld(世界之窗浏览器)" if Instr(TheInfo,UCase("icafe8"))>0 then GetBrType = GetBrType & "-icafe8(网维大师网吧管理插件)" if Instr(TheInfo,UCase("TencentTraveler"))>0 then GetBrType = GetBrType & "-TencentTraveler(腾讯TT浏览器)" if Instr(TheInfo,UCase("baiduie8"))>0 then GetBrType = GetBrType & "-baiduie8(百度IE8.0)" if Instr(TheInfo,UCase("iCafeMedia"))>0 then GetBrType = GetBrType & "-iCafeMedia(网吧网媒趋势插件)" if Instr(TheInfo,UCase("DigExt"))>0 then GetBrType = GetBrType & "-DigExt(IE5允许脱机阅读模式特殊标记)" if Instr(TheInfo,UCase("baiduds"))>0 then GetBrType = GetBrType & "-baiduds(百度硬盘搜索)" if Instr(TheInfo,UCase("CNCDialer"))>0 then GetBrType = GetBrType & "-CNCDialer(数控拨号)" if Instr(TheInfo,UCase("NOKIAN85"))>0 then GetBrType = GetBrType & "-NOKIAN85(诺基亚手机)" if Instr(TheInfo,UCase("SPV_C600"))>0 then GetBrType = GetBrType & "-SPV_C600(多普达C600)" if Instr(TheInfo,UCase("Smartphone"))>0 then GetBrType = GetBrType & "-Smartphone(Windows Mobile for Smartphone Edition 操作系统的智能手机)" End Function Response.Write GetBrType %>
转载自:http://lcx.cc/?i=482
本文地址:/514/
-
• 通用ASP生成HTML代码,无需读取模版
• asp检测email地址是否有效函数
• 把Access 2010 .accdb文件格式转换为Access 2003 .mdb操作方法
• 兼容ie,火狐,chrome,safari,360,qq,遨游,搜狗等浏览器的设为首页和加入收藏代码
• 利用ASP显示当前网站在线人数代码
• fckeditor报错FCKLang undefined(fcklang未定义)的解决方法
• windows 2003通过squid搭建cdn节点加速服务
• ASP编程中经常用到的ASP代码,很有用的哦
• 网页加密攻略:使用ASP程序密码锁
• JS、ASP、PHP自动检测浏览器语言并转到相关URL
-
• 点击一个超级链接,能同时打开两个网页/网站的代码
• Chrome浏览器打开https网站提示“您的连接不是私密连接”解决办法
• 兼容ie,火狐,chrome,safari,360,qq,遨游,搜狗等浏览器的设为首页和加入收藏代码
• 利用ASP显示当前网站在线人数代码
• fckeditor报错FCKLang undefined(fcklang未定义)的解决方法
• ASP编程中经常用到的ASP代码,很有用的哦
• EASEUS Partition Master 5.0.1 Unlimited Edition无损磁盘分区调整工具教程
• Anti-VirusTools2007魏滔序(最好用的熊猫烧香病毒专杀工具)
• ASP禁止站外提交表单(不允许从外部提交数据)
• 2006年薪酬调查报告分析