I have been working on recently and need to use Asp to get the agent information of the browser. I haven't played ASP for a long time. Let's take a look at it first and summarize the results and share them with everyone.
WEB development often uses userAgent information from various mainstream browsers. Let’s take a look at how to obtain asp.
Usage example 1
- <%
- dima
- a=Browsr
- ifInStr(a,MSIE)then
- 'browserisInternetExplorer
- else
- 'browserissomeothertype...
- endif
- %>
ASP Source Code:
- <%
- PrivateFunctionBrowsr()
- Browsr=Request.ServerVariables(HTTP_USER_AGENT)
- EndFunction
- %>
Example 2:
How to get the current browser UA of ASP:
- <%
- dimua
- ua=Request.ServerVariables(HTTP_USER_AGENT)
- response.writeua
- %>
The above is the entire content of this article, I hope you like it.