查看: 5269|回复: 2

[文章教程] asp判断用户端是电脑访问还是移动设备方法

[复制链接]
ttasp 发表于 2014-6-28 22:43:10 | 显示全部楼层 |阅读模式
<%
set regex = new regexp
regex.ignorecase = true
regex.global = true
regex.pattern = "mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370|sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888|nx250|n120|mtk |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|_mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_touch|355x|m50|km100|d736|p-9521|telco|sl74|ktouch|m4u\/|me702|8325rc|kddi|phone|lg |sonyericsson|samsung|240x|x320vx10|nokia|sony cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo|iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile|ipod|iphone|android|opera mini|blackberry|palm os|palm|hiptop|avantgo|fennec|plucker|xiino|blazer|elaine|iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile"

agent = request.ServerVariables("HTTP_USER_AGENT") & ""
if agent <> "" then
     
    if   regex.test(agent) then
     response.write "是从手机"
    else
        response.write "不是从手机"
    end if
end if


%>

评分

1

查看全部评分

织梦人 发表于 2019-4-21 20:08:05 | 显示全部楼层
好东西,不错啊!
王先生 发表于 2024-3-24 13:49:04 | 显示全部楼层
本帖最后由 王先生 于 2024-3-24 22:56 编辑
  1. var system ={  
  2. win : false,  
  3. mac : false,  
  4. xll : false  
  5. };  
  6. var p = navigator.platform;  
  7. system.win = p.indesOf("Win") == 0;
  8. system.mac = p.indesOf("Mac") == 0;  
  9. system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
  10. if(system.win||system.mac||system.xll){  
  11. }else{  
  12. window.location.href="M/";  
  13. }  
复制代码


html5方法,给大家分享。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号