- 注册时间
- 2011-3-21
- 最后登录
- 2022-3-22
- 在线时间
- 1191 小时
- 阅读权限
- 200
- 积分
- 9457
- 帖子
- 1256
- 精华
- 0
- UID
- 1
|
呵呵- <%
- '判断是否是手机上网
- 'response.write Request.ServerVariables("HTTP_ACCEPT")&"<BR>"
- 'response.write Request.ServerVariables("HTTP_USER_AGENT")&"<BR>"
- URL="http://www.iscripts.org/?mobile=yes"
- If Request.ServerVariables("HTTP_X_WAP_PROFILE") Then '如果有HTTP_X_WAP_PROFILE则是手机
- ' response.write "手机用户1"
- response.redirect URL
- response.End
- End If
- '如果只支持wml并且不支持html则是手机
- If InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"vnd.wap.wml") > 0 And InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/html")=0 Then
- ' Response.write "手机用户2"
- response.redirect URL
- response.End
- End If
- '如果支持wml和html但是wml在html之前则是移动设备
- If InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"vnd.wap.wml") And InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/html") Then
- If InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"vnd.wap.wml")< InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/html") Then
- ' Response.write "手机用户3"
- response.redirect URL
- respone.End
- End If
- End If
- '如果手机User_Agent有品牌特征符则是手机
- Set reg = New RegExp
- str="CECT,Compal,CTL,LG,NEC,TCL,Alcatel,Ericsson,BIRD,DAXIAN,DBTEL,Eastcom,PANTECH,Dopod,PHILIPS,HAIER,KONKA,KEJIAN,LENOVO,BenQ,MOT,Soutec,Nokia,SAGEM,SGH,SED,Capitel,Panasonic,SonyEricsson,SIE,SHARP,Amoi,PANDA,ZTE"
- str=Replace(str,",",")|(")
- reg.pattern=".*("&str&").*"
- reg.IgnoreCase = True
- response.write str&"<BR>"®.pattern
- If reg.test(Request.ServerVariables("HTTP_USER_AGENT")) Then
- ' response.write "手机用户4"
- response.redirect URL
- respone.End
- End If
- %>
复制代码 |
|