首页 > 编程 > ASP > 正文

asp获得浏览器agent信息代码

2020-07-27 12:40:50
字体:
来源:转载
供稿:网友

WEB开发经常用到各个主流浏览器的userAgent信息,我们来看看asp如何来获取呢

使用范例一

<%dim aa = Browsrif InStr( a, "MSIE" ) then   ' browser is Internet Explorerelse   ' browser is some other type...end if%>

ASP Source Code:

<%Private Function Browsr()  Browsr = Request.ServerVariables("HTTP_USER_AGENT")End Function%>

范例二:

ASP获取当前浏览器UA的方法:

<% dim ua ua=Request.ServerVariables("HTTP_USER_AGENT") response.write ua %>

以上所述就是本文的全部内容了,希望大家能够喜欢。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表