ASP识别手机客户端和电脑客户端

网址:amzoo.cn 发布时间:2021/1/5 来源:广州扬帆科技网 人气:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%
HTTP_ACCEPT=Request.ServerVariables("HTTP_ACCEPT")
HTTP_USER_AGENT=LCase(Request.ServerVariables("HTTP_USER_AGENT"))
HTTP_X_WAP_PROFILE=Request.ServerVariables("HTTP_X_WAP_PROFILE")
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 "手机客户端"
response.end
else
Response.Write "电脑客户端"
response.end
End if
%>
【打印】【关闭】【加入收藏】 top↑
上一篇:如何设置鼠标和键盘任意键唤醒电脑休眠
下一篇:微信小程序收费吗,微信小程序与手机APP的区别