function wap()
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
else
Response.Write "请使用手机访问本系统,电脑请直接访问 <a href='http://"&SiteUrl&"'>"&SiteUrl&"</a> 。"
response.end
End if
End function
服务器和客户端都可以判断,服务器端用asp的 Request.ServerVariables方法,判断代码如下
<%
Dim BrowserString
BrowserString = Request.ServerVariables("HTTP_USER_AGENT")
BrowserString = Lcase(BrowserString)
Dim broFirefox,broMSIE,broOpera,broWap
broFirefox = "firefox"
broMSIE = "msie"
broOpera = "opera"
broWap = "wap"
'如果是Firefox
if Instr(BrowserString, broFirefox) <> 0 then
Response.Redirect(broFirefox & ".asp")
end if
'如果是MSIE
if Instr(BrowserString, broMSIE) <> 0 then
Response.Redirect(broMSIE & ".asp")
end if
'如果是Opera
if Instr(BrowserString, broOpera) <> 0 then
Response.Redirect(broOpera & ".asp")
end if
'如果是Wap
if Instr(BrowserString, broWap) <> 0 then
Response.Redirect(broWap & ".asp")
end if
%>
自己可以用Request.ServerVariables("HTTP_USER_AGENT") 看下360浏览器的值,然后自己增加条件判断。