<!---------------START----------------->
<%
HTTP_ACCEPT=LCase(Request.ServerVariables("HTTP_ACCEPT"))
HTTP_USER_AGENT=LCase(Request.ServerVariables("HTTP_USER_AGENT"))
Dim UserType
If InStr(HTTP_ACCEPT,"text/vnd.wap.wml")>0 Then
UserType="Phone"
Else
ArrayStr=Split("android,iphone,ipod,ipad,windows phone,wp7,symbian,symb,samsung,nokia,htc,motorola,blackberry,ucbrowser,ucweb,mqqbrowser,mini,mobi",",")
For i=0 To UBound(ArrayStr)
If InStr(HTTP_USER_AGENT,ArrayStr(i))<>0 Then
UserType="Phone"
Exit For
End If
Next
End If
If UserType="" Then
UserType="PC"
End If
Response.Write UserType
%>
<!---------------END---------------->
参考:
转载于:https://blog.51cto.com/332374363/1085584