2025-04-27 07:49:33 -04:00

136 lines
5.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>Browser Capabilities Component</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
TempString = navigator.appVersion
if (navigator.appName == "Microsoft Internet Explorer"){
// Check to see if browser is Microsoft
if (TempString.indexOf ("4.") >= 0){
// Check to see if it is IE 4
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else {
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
}
}
else if (navigator.appName == "Netscape") {
// Check to see if browser is Netscape
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
//-->
</script>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnLoad()
Dim frmContents
On Error Resume Next
If Not Parent Is Nothing Then
Set frmContents = Parent.Contents
If Not frmContents Is Nothing Then
frmContents.Window.TOCSynch_Click
End If
End If
End Sub
//--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
<META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="MS-IT-LOC" Content="Internet Information Services">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1><A NAME="_browser_capabilities_component"></A><SUP></SUP>Browser Capabilities Component</H1>
<P>The<B> </B>Browser Capabilities<B> </B>component creates a <B>BrowserType</B> object that provides your scripts with a description of the capabilities of the client's Web browser.</P>
<P>When a browser connects to the Web server, it automatically sends an HTTP User Agent header. This header is an ASCII string that identifies the browser and its version number. The <B>BrowserType </B>object compares the header to entries in the Browscap.ini file.</P>
<P>If it finds a match, the <B>BrowserType </B>object assumes the properties of the browser listing that matched the User Agent header.</P>
<P>If the object does not find a match for the header in the Browscap.ini file, it searches for the closest match using the * and ? wildcards. If a match can not be found using wildcards, the object will use the default browser settings if they have been specified in the Browscap.ini file. If the object does not find a match and default browser settings have not been specified in the Browscap.ini file, the object sets every property to the string "UNKNOWN."</P>
<P>You can add properties or new browser definitions to this component simply by updating the Browscap.ini file.</P>
<H6>File Names</H6>
<TABLE border=0 cellpadding=5 cols=2 frame=box rules=all>
<TR VALIGN="top">
<TD width=28%>Browscap.dll</TD>
<TD width=72%>The Browser Capabilities component.</TD>
</TR>
<TR VALIGN="top">
<TD width=28%><A HREF="/iishelp/iis/htm/asp/comp1g11.htm">Browscap.ini File</A></TD>
<TD width=72%>A text file that maps browser capabilities to the HTTP User Agent header. This file must be in the same directory as Browscap.dll.</TD>
</TR>
</TABLE><BR>
<H6>Syntax</H6>
<P><B>Set </B><I>BrowserType </I><B>= Server.CreateObject("MSWC.BrowserType") </B></P>
<H6>Parameters</H6>
<DL>
<DT><I>BrowserType </I></DT>
<DD>Specifies the name of the <B>BrowserType </B>object created by the call to <B>Server.CreateObject</B>.</DD>
</DL>
<H6>Example</H6>
<P>The following example uses the <B>BrowserType</B> object to display a table showing some of the capabilities of the current browser. </P>
<P>--- Browscap.asp ---</P>
<PRE><CODE>&lt;% Set bc = Server.CreateObject("MSWC.BrowserType") %&gt;
&lt;TABLE BORDER=1 CELLPADDING=4&gt;
&lt;TR&gt;
&lt;TD&gt;Browser&lt;/TD&gt;
&lt;TD&gt;&lt;%= bc.browser %&gt;
&lt;TR&gt;
&lt;TD&gt;Version&lt;/TD&gt;
&lt;TD&gt;&lt;%= bc.version %&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Frames&lt;/TD&gt;
&lt;TD&gt;&lt;%= bc.frames %&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Tables&lt;/TD&gt;
&lt;TD&gt;&lt;%= bc.tables %&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Cookies&lt;/TD&gt;
&lt;TD&gt;&lt;%= bc.cookies %&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;BackgroundSounds&lt;/TD&gt;
&lt;TD&gt;&lt;%= bc.BackgroundSounds %&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;VBScript&lt;/TD&gt;
&lt;TD&gt;&lt;%= bc.vbscript %&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;JScript&lt;/TD&gt;
&lt;TD&gt;&lt;%= bc.javascript %&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ActiveX Controls&lt;/TD&gt;
&lt;TD&gt;&lt;%= bc.ActiveXControls %&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TABLE&gt;
</CODE></PRE>
<hr class="iis" size="1">
<p align="center"><em><a href="../../../common/colegal.htm">&copy; 1997-2001 Microsoft Corporation. All rights reserved.</a></em></p>
</BODY>
</HTML>