当前位置:主页 > 查看内容

asp获得浏览器agent信息代码

发布时间:2021-04-19 00:00| 位朋友查看

简介: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 Brow……

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

使用范例一

<%
dim a
a = Browsr
if InStr( a, "MSIE" ) then
   ' browser is Internet Explorer
else
   ' 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 
%>

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


原文链接:https://m.jb51.net/article/66361.htm
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!

推荐图文


随机推荐