Asp classic 在asp中检测HTTP_用户_代理

Asp classic 在asp中检测HTTP_用户_代理,asp-classic,user-agent,Asp Classic,User Agent,我需要在一个asp网站,检测所使用的设备是否是平板电脑。 我想知道这一次使用哪个用户代理 现在我这样做 agent = Request.ServerVariables("HTTP_USER_AGENT") Set reg = New RegExp With reg .Pattern = "(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|pal

我需要在一个asp网站,检测所使用的设备是否是平板电脑。 我想知道这一次使用哪个用户代理

现在我这样做

agent = Request.ServerVariables("HTTP_USER_AGENT")

    Set reg = New RegExp
    With reg
        .Pattern = "(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm)"
        .IgnoreCase = True
        .Global = True
    End With

    match = reg.Test(agent)

    If match Then
        session("IsMobileBrowser") = 1
    Else
        session("IsMobileBrowser") = 0
    End If

谢谢

我们正在使用此API在我们的经典asp网站上检测移动设备,效果非常好。

使用DetectTablet功能检测药片

同样,代码很少改动,我们就能够在服务器端包含它。必须更换:

if (navigator && navigator.userAgent)
    this.uagent = navigator.userAgent.toLowerCase();


谢谢,但是你知道平板电脑的价值吗?我不知道为什么我今天之前没有看到你的评论,但是很抱歉我不理解你的问题,你能解释一下吗?
if (Request.ServerVariables("HTTP_USER_AGENT").Item != null)
    this.uagent = Request.ServerVariables("HTTP_USER_AGENT").Item.toLowerCase();