136 lines
5.2 KiB
HTML
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><% Set bc = Server.CreateObject("MSWC.BrowserType") %>
|
|
|
|
<TABLE BORDER=1 CELLPADDING=4>
|
|
<TR>
|
|
<TD>Browser</TD>
|
|
<TD><%= bc.browser %>
|
|
<TR>
|
|
<TD>Version</TD>
|
|
<TD><%= bc.version %></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>Frames</TD>
|
|
<TD><%= bc.frames %></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>Tables</TD>
|
|
<TD><%= bc.tables %></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>Cookies</TD>
|
|
<TD><%= bc.cookies %></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>BackgroundSounds</TD>
|
|
<TD><%= bc.BackgroundSounds %></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>VBScript</TD>
|
|
<TD><%= bc.vbscript %></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>JScript</TD>
|
|
<TD><%= bc.javascript %></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>ActiveX Controls</TD>
|
|
<TD><%= bc.ActiveXControls %></TD>
|
|
</TR>
|
|
</TABLE>
|
|
</CODE></PRE>
|
|
<hr class="iis" size="1">
|
|
<p align="center"><em><a href="../../../common/colegal.htm">© 1997-2001 Microsoft Corporation. All rights reserved.</a></em></p>
|
|
</BODY>
|
|
</HTML>
|