<%
Function CheckMobile()
if InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/vnd.wap.wml")>0 then
CheckMobile=True:Exit Function
end if
'是否专用wap浏览器
If InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")), "application/vnd.wap.xhtml+xml") Or Not IsEmpty(Request.ServerVariables("HTTP_X_PROFILE")) Or Not IsEmpty(Request.ServerVariables("HTTP_PROFILE")) Then
CheckMobile=True:Exit Function
End If
'是否(智能)手机浏览器
Dim MobileBrowser_List,PCBrowser_List,UserAgent
Set MobileBrowser_List = New RegExp '建立正则表达式
Set PCBrowser_List = New RegExp '建立正则表达式
MobileBrowser_List.Pattern ="up.browser|up.link|mmp|iphone|android|wap|netfront|java|opera\smini|ucweb|windows\sce|symbian|series|webos|sonyeriCSSon|sony|blackberry|cellphone|dopod|nokia|samsung|palmsource|palmos|pda|xphone|xda|smartphone|pieplus|meizu|midp|cldc|brew|tear"
PCBrowser_List.Pattern="mozilla|chrome|safari|opera|m3gate|winwap|openwave"
UserAgent = LCase(Request.ServerVariables("HTTP_USER_AGENT"))
If MobileBrowser_List.Test(UserAgent) Then
CheckMobile=True:Exit Function
ElseIf PCBrowser_List.Test(UserAgent) Then '未知手机浏览器,其UA标识为常见浏览器,不跳转
CheckMobile=False:Exit Function
Else
CheckMobile=False
End If
End Function
if CheckMobile then
Response.redirect "mobile.asp"
end if%>