ASP がブラウザとバージョン番号を決定します
著者:Eve Cole
更新時間:2009-06-26 18:10:03
程序代
<%
Dim エージェント、ブラウザ、バージョン、tmpstr
Agent=Request.ServerVariables("HTTP_USER_AGENT")
エージェント=分割(エージェント,";")
InStr(Agent(1),"MSIE")>0 の場合
ブラウザ=「MS Internet Explorer」
version=Trim(Left(Replace(Agent(1),"MSIE",""),6))
ElseIf InStr(Agent(4),"Netscape")>0 then
ブラウザ=「ネットスケープ」
tmpstr=Split(エージェント(4),"/")
version=tmpstr(UBound(tmpstr))
ElseIf InStr(Agent(4),"rv:")>0 then
ブラウザ=「Mozilla」
tmpstr=Split(エージェント(4),":")
version=tmpstr(UBound(tmpstr))
InStr(version,")") > 0 の場合
tmpstr=Split(バージョン,")")
バージョン=tmpstr(0)
終了の場合
終了の場合
response.Write(""&ブラウザ&" "&バージョン&"")
%>