當前位置:首頁 > 建站常識 > 列表

ASP判斷手機訪問并跳轉的(de)代碼

點擊:時(shí)間:2016/3/20關鍵詞:ASP UA判斷浏覽器
<%HTTP_ACCEPT=Request.ServerVariables("HTTP_ACCEPT") '獲取浏覽器信息HTTP_USER_AGENT=LCase(Request.ServerVariables("HTTP_USER_AGENT"))
<%
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")                   '手機系統 電腦(nǎo)爲空
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.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.021jz.com.cn"
End if%>
預約建站
免費提供網站優化(huà)
領取關鍵詞