???? ID: 272413 - ????? ???????: 02 ?????? 2010 - ??????: 2.0

How To Determine Browser Type in Server-Side Script Without the BrowserType Object

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
??? ?? ??????? ???? | ??? ?? ??????? ????

??????

There are two common methods in server-side script to determine information about the browser that is being used by the client:
  • TheBrowserTypeobject
  • TheRequest.ServerVariables("HTTP_USER_AGENT")method
This article describes theRequest.ServerVariables("HTTP_USER_AGENT")method, which provides more detailed information about the browser than theBrowserType???????? ??? For additional information about theBrowserTypeobject (as well as the use of client-side script to obtain browser information), click the article number below to view the article in the Microsoft Knowledge Base:
167820  (http://support.microsoft.com/kb/167820/EN-US/ ) ??? ????????? ?? ???????? ??????? ?? ???????? ???? ????
??????????: ?? ?? ???? ??? ???????? ??????? ????????? ???? ?? ?????? ???? ?? ??? ??? "HTTP_USER_AGENT" ???????? ?? ??????? ???? ?? ??? ???? ?? ?????? ??? ??? ???????? ????? ?? ????????? ????? ??????? ???? ?? ?? ???????? ???? ???? ???? ?? ?? ?? ???? ??? ?????? ?? ???, ??????? HTTP_USER_AGENT ???????? Opera 5.12 ???? ?? ?? "Mozilla/4.0 (????; MSIE 5.0; <operating system="">) Opera 5.12 [??]"? ?? ???????? ???????? ?? ???? ??? ???????? ?? ??? ??? ?? ?? ??????? ?? ???????? ???? ?? ??? ????? ?? ?? Internet Explorer 5 ???? ??.</operating>

??? ?? Internet Explorer ??????? 5 ?? ??? (?? Microsoft Win32 ?? Unix ???????????? ????) ?? ??????? ?? ???? ?? ???????? ??, ?? ?????isComponentInstalled??,getComponentVersionCLIENTCAPS ??????? ?? ???????? ?? ??????? ?? ???? ??? ??????? ?? ??? ????? Microsoft ??? ???? ?????:
HTTP://msdn2.Microsoft.com/en-us/library/ms531357.aspx (http://msdn2.microsoft.com/en-us/library/ms531357.aspx)

HTTP://msdn2.Microsoft.com/en-us/library/ms531350.aspx (http://msdn2.microsoft.com/en-us/library/ms531350.aspx)
???:: ??? ??????? Internet Explorer 5 ?? ??? ??? (Microsoft Win32 ?? Unix ???????????? ????) ???? ?? ?? ??????? ????????

???? ???????

????? ????? ??? illustrates ?? ?????Request.ServerVariables("HTTP_USER_AGENT"):
<%
   dim UserAgent
	
   UserAgent = Request.ServerVariables("HTTP_USER_AGENT")
   Response.Write "<p>" & UserAgent & "</p>"
	
   if instr(1,UserAgent,"MSIE") > 0 then
      Response.Write "Browser is Internet Explorer"
   else
      if instr(1,UserAgent,"MSPIE") > 0 then
         Response.Write "Browser is Pocket Internet Explorer"
      else
         Response.Write "Browser is not Internet Explorer"
      end if
   end if
%>
				
Microsoft Internet Explorer 5.0, ??? ?? ??? ???? ????? ???? ?? ????:
Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) 

Browser is Internet Explorer
				
?? ????? ??? ?? Internet Explorer ?? ??? ???? ??? ???????? ?? ????? ???? ??, ????? ???? ?? ??? ?? ??????? ???? ?? ?? ???????? ?? ??? ???? ?????? ???? ??HTTP_USER_AGENT?? ????? ??? ?? ??? ??????? ????? ?? ???? ????HTTP_USER_AGENT??? ??? ????, ?? ?? ?? ??? ????? ???? ??? ?? ?? ??? ?? ??????? ?????? ???

???? HTTP_USER_AGENT ????? ?? ?? ????????? ???? ????? ??:
   Internet Explorer
     - Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
     - Mozilla/4.0 (compatible; MSIE 4.0 Crawler; Windows 95)

   Netscape Navigator
     - Mozilla/4.0b1 (Win95; I)
     - Mozilla/3.01Gold (Macintosh; U; PPC)
				
??????? ?????????? ?? ????? ?? ?????, Browscap.ini ??? ?? ??? ????? ?? ??? ???? ????? ????? ?? ??? ????, ?? ?????? ??? ?????? Browscap.ini Internet Explorer ?? ???????? ????????, ??? ?? Oracle ?? Opera ?? ????????? ?? ??? ????? ?? ???? ??? ??? ?? cyScape ?? ????? ??? ???? ?? ?? Browscap.ini ?? ?????? ??????? ??????? ?? ???? ???:
HTTP://www.cyscape.com/ASP/browscap (http://www.cyscape.com/asp/browscap)
?????? ?????? ???? ??? ???? ?????? ???? ?? ??? Microsoft ???? ?????-???? ?????? ??????? ?????? ????? ??.. ?? ?????? ??????? ???? ???? ????? ????? ?? ??? ???? ??.. Microsoft ?? ?????-???? ?????? ??????? ?? ??? ???? ?? ??? ?????? ???? ????..

???? ???? ???? ??:
  • Microsoft Visual InterDev 6.0 Standard Edition
  • Microsoft Active Server Pages 4.0
??????: 
kbaspobj kbcodesnippet kbhowto kbmt KB272413 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:272413  (http://support.microsoft.com/kb/272413/en-us/ )