湖南道川网络公司
网络资讯动态及建站技术分享 互联网百科知识汇集分享

ASP判断识别电脑手机移动端访问时自动跳转到指定的代码

代码是主要作用是,同一个URL地址,不同的终端设备访问打开,会自动跳到设置的代码,简单来说就是同一个网址不同的设备访问不同的代码。
HTTP_ACCEPT=Request.ServerVariables("HTTP_ACCEPT")                 '获取浏览器信息
HTTP_USER_AGENT=LCase(Request.ServerVariables("HTTP_USER_AGENT"))  '获取AGENT
HTTP_X_WAP_PROFILE=Request.ServerVariables("HTTP_X_WAP_PROFILE")   'WAP特定信息 品牌机自带浏览器都会有
HTTP_UA_OS=Request.ServerVariables("HTTP_UA_OS")                   '手机系统 电脑为空
HTTP_VIA=LCase(Request.ServerVariables("HTTP_VIA"))                '网关信息
Dim WapStr
WAPstr=False
If ubound(split(HTTP_ACCEPT,"vnd.wap"))>0 Then WAPstr=True
If HTTP_USER_AGENT="" Then  WAPstr=True
If HTTP_X_WAP_PROFILE<>"" Then  WAPstr=True
If HTTP_UA_OS<>"" Then  WAPstr=True
IF ubound(split(HTTP_VIA,"wap"))>0 Then  WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"netfront"))>0 Then  WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"iphone"))>0 Then  WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"opera mini"))>0 Then  WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"ucweb"))>0 Then  WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"windows ce"))>0 Then  WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"symbianos"))>0 Then  WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"java"))>0 Then  WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"android"))>0 Then  WAPstr=True
If WAPstr=True Then    
Response.Write "请访问手机版本 https://m.0733.com.cn"   
response.redirect " https://www.0733.com.cn"
response.end
else   
'response.redirect " https://www.0733.com.cn "
'response.end
End if


本文标题:ASP判断识别电脑手机移动端访问时自动跳转到指定的代码
本文链接:https://wz.0733.com.cn/web/news-27.html
  • 简述app项目开发三个阶段及相应的主要步骤关于企业网站对于搜索引擎的优化策略为什么企业邮箱对外贸出口公司那么重要?
  • 网易企业邮箱新增企业网盘功能网易企业邮箱走进东北 推进高校教育信息化影响网站在搜索引擎中的一些排名因素增强个人风险防范意识,与钓鱼邮件说永别80万家企业都在用的网易企业邮箱到底凭什么脱颖而出为企业通信护航,网易企业邮箱提出多重策略网易企业邮箱管理平台在线自助升级的说明网易企业邮箱:我们提供初创企业需要的一切网易企业邮箱新增容量报警功能网易企业邮箱关于反垃圾邮件的公告什么样的网站百度比较喜欢
  • top