ASP
  Home arrow ASP arrow Browscap.ini File
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

Browscap.ini File
By: Steve Schofield
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 24
    2002-01-01

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    You can declare property definitions for any number of browsers in the Browscap.ini file. You can also set default values to use if the client's browser is not one of the listed definitions.

     

    You can declare property definitions for any number of browsers in the Browscap.ini file. You can also set default values to use if the client's browser is not one of the listed definitions.

    For each browser definition, you provide an HTTP User Agent header and the properties and values you wish to associate with that header. For more information on the format of the HTTP User Agent header, refer to the HTTP specification available at http://www.w3.org.

    Syntax

    [; comments]

    [HTTPUserAgentHeader]

    [parent = browserDefinition]

    [property1 = value1]

    ...

    [propertyN = valueN]

     

    [Default Browser Capability Settings]

    [defaultProperty1 = defaultValue1]

    ...

    [defaultPropertyN = defaultValueN]


    Parameters
    comments
    Any line that starts with a semicolon (;). Comments, which are ignored by the BrowserType object, can occur anywhere in the Browscap.ini file.
    HTTPUserAgentHeader
    Specifies the HTTP User Agent header to associate with the browser-property value statements specified in propertyN. The Browscap.ini file may contain multiple browser definitions, each one starting with a unique HTTPUserAgentHeader value.

    You can use the asterisk (*) character as a wildcard character in HTTPUserAgentHeader to replace zero or more characters and the (?) character as a wildcard to replace a single character.

    For example, if you specified the following string for HTTPUserAgentHeader:

    [Mozilla/4.0 (compatible; MSIE 5.0;* Windows NT)]

     

    It would match all of the following User Agent headers:

    [Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)]

    [Mozilla/4.0 (compatible; MSIE 5.0; AK; Windows NT)]

    [Mozilla/4.0 (compatible; MSIE 5.0; SK; Windows NT)]

    Note   The BrowserType object first attempts to match the HTTP User Agent header to a value of HTTPUserAgentHeader exactly. If that fails, it attempts to make a match that uses wildcard characters.

    If more than one browser definition containing wildcard characters matches the User Agent header, the BrowserType object returns the properties of the definition which most closely matches the User Agent header. The closest match is the match which replaces the fewest characters.

    browserDefinition
    An optional parameter specifying the HTTP User Agent header-string of a browser to use as the parent browser. The current browser's definition will inherit all of the property values declared in the parent browser's definition. This helps define properties for a new version of a browser, because new versions usually retain most of the properties of the previous release. These inherited property values can be overwritten by explicitly setting a new value for the property by using the syntax propertyN = valueN.
    propertyN
    An optional parameter specifying the name of the browser property to set. It must start with an alphabetic character and cannot be longer than 255 characters. Each browser definition in the Browscap.ini file can contain as many statements of property values as needed. For example, if your application only needed to know whether or not a user's browser supported VBScript, you would only need one property statement for each browser definition.

    The following table lists some possible properties:
    PropertyDescription
    ActiveXControlsSpecifies whether the browser supports ActiveX® controls.
    BackgroundsoundsSpecifies whether the browser supports background sounds.
    BetaSpecifies whether the browser is beta software.
    BrowserSpecifies the name of the browser.
    CdfSpecifies whether the browser supports the Channel Definition Format for Webcasting.
    CookiesSpecifies whether the browser supports cookies.
    FramesSpecifies whether the browser supports frames.
    JavaappletsSpecifies whether the browser supports Java applets.
    JavascriptSpecifies whether the browser supports JScript.
    PlatformSpecifies the platform that the browser runs on.
    TablesSpecifies whether the browser supports tables.
    VbscriptSpecifies whether the browser supports VBScript.
    VersionSpecifies the version number of the browser.


    valueN
    An optional parameter specifying the value of propertyN. This value is a string by default. To specify an integer, prefix the value with a number sign (#). To specify a Boolean value, use TRUE or FALSE.
    defaultPropertyN
    An optional parameter specifying the name of the browser property to which to assign a default value if none of the defined HTTPUserAgentHeader values match the HTTP User Agent header sent by the browser.
    defaultValueN
    An optional parameter specifying the value of defaultPropertyN. This value is a string by default. To specify an integer, prefix the value with a number sign (#). To specify a Boolean value, use TRUE or FALSE.
    Example

    In the following example, the parent tag allows the second browser definition to inherit from the first, so that the Microsoft® Internet Explorer 5.x definition inherits all the properties of Microsoft® Internet Explorer 5.0 definition (for example, frames=TRUE, tables=TRUE, and cookies=TRUE). It adds platform-specific information by adding the line, platform=WinNT.

    ;;ie 5.0
    [IE 5.0]
    browser=IE
    Version=5.0
    majorver=#5
    minorver=#0
    frames=TRUE
    tables=TRUE
    cookies=TRUE
    backgroundsounds=TRUE
    vbscript=TRUE
    javascript=TRUE
    javaapplets=True
    ActiveXControls=TRUE
    Win16=False
    beta=False
    AK=False
    SK=False
    AOL=False
    ;;ie 5.x
    [Mozilla/4.0 (compatible; MSIE 5.*; Windows NT)]
    parent=IE 5.0
    version=5.0
    minorver=0
    platform=WinNT
    ; Default Browser 
    [*]
    browser=Default
    frames=FALSE 
    tables=TRUE 
    cookies=FALSE 
    backgroundsounds=FALSE 
    vbscript=FALSE 
    javascript=FALSE

    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More ASP Articles
    More By Steve Schofield

     

    IBM® developerWorks developerWorks - FREE Tools!


    NEW! Addressing software-as-a-service challenges using Tivoli security and WebSphere solutions

    Building a software-as-a-service solution requires addressing a few key technical challenges. In this webcast, we'll focus on the role of IBM Tivoli Directory Server and WebSphere Portlet Factory in creating a Software as a Service solution. We will demonstrate how to use Tivoli Directory Server to prevent the user population of one tenant from accessing the virtual portal and portlet components of another tenant. We will also use the dynamic profile capability of WebSphere Portlet Factory to create multiple highly customized applications from one code base.
    FREE! Go There Now!


    NEW! Best Practices in Integrated Requirements Management

    Poor Requirements Management capabilities in an Enterprise have been linked to excessive project failures, escalating IT costs, and failure to deliver competitive advantage into the marketplace. Join Brianna M Smith from IBM Rational and learn about how successful organizations align IT and Business stakeholders through collaborative processes and tools for effective requirements management, and how an integrated approach across the IT lifecycle can provide unparalleled visibility and traceability to ensure that project teams are delivering on the business vision by "doing the right things" and "doing things right."
    FREE! Go There Now!


    NEW! Download DB2 9.5 for Linux, Unix, and Windows

    Download a free trial version of IBM DB2 9.5 for Linux, UNIX, and Windows. DB2 9 is the result of a five-year development project that transformed traditional (static) database technology into an interactive data server that merges the high performance and ease of use of DB2 with the self-describing benefits of XML.
    FREE! Go There Now!


    NEW! Evaluate IBM Lotus Sametime Standard V8.0

    Visit IBM developerWorks to download a free trial of the latest release of IBM Lotus Sametime Standard V8.0. Lotus Sametime Standard V8.0 is a platform for unified communications and collaboration that combines security features with an extensible, open solution including integrated Voice over IP, geographic location awareness, mobile clients, and a robust Business Partner community offering telephony and video integration.
    FREE! Go There Now!


    NEW! Evaluate IBM Rational Developer for System i V7.1

    Download a free trial version of IBM Rational Developer for System i V7.1, which provides a complete development environment for traditional i5/OS application development. IBM Rational Developer for System i is a new eclipse-based workstation offering for i5/OS application development that provides a comprehensive Integrated Development Environment for edit/compile/debug of traditional RPG/COBOL/C/C++ i5/OS applications.
    FREE! Go There Now!


    NEW! Hello World: Monitor a simple business process using WebSphere Business Monitor V6.0.2

    This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product.
    FREE! Go There Now!


    NEW! Rational Build Forge Express eKit

    Rational Build Forge Express Edition is an automation framework that packages the latest enterprise-grade technologies into a reliable, flexible and robust configuration designed and priced specifically for small to midsize businesses. The new Rational Build Forge Express eKit provides you with valuable resources – including a case study, podcast, demo, and articles – to help you increase staff productivity, compress development cycles and deliver better software, fast.
    FREE! Go There Now!


    NEW! Rational Talks to You: Manage RUP-based CMMI initiatives

    Join this Rational Talks to You teleconference on December 4 at 1:00 pm ET to discuss how Rational Method Composer can help meet your compliance objectives. Get your questions answered!
    FREE! Go There Now!


    NEW! Webcast: Accelerating Software Innovation with System z

    Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, where he will overview Rational’s new offerings and programs to help customers accelerate software innovation on System z. He will discuss how these solutions help organizations extend their core business processes toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time.
    FREE! Go There Now!


    NEW! Webcast: Extreme transaction processing with WebSphere Extended Deployment

    In this webcast, you'll get an introduction to the eXtreme Transaction Processing (XTP) features of WebSphere Extended Deployment and the common architectural traits required by XTP applications. See how WebSphere Extended Deployment's ObjectGrid feature provides a state-of-the-art infrastructure for hosting XTP applications.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    ASP ARTICLES

    - Using MySQL with ASP
    - ADO for the Beginner
    - ADO.NET 101: Data Rendering with a DataGrid ...
    - Introducing SoftArtisans OfficeWriter 3.0 En...
    - Getting Remote Files With ASP
    - The Real Basics of Functions in ASP
    - Enhancing Readability with ASP
    - Mimicking PHP's String Formatting Functions
    - Windows Server Hacks 12, 77, and 98
    - How to Sort a Multi-Dimensional Array
    - Developing an Information Management Tool wi...
    - What are Active Server Pages?
    - Getting Remote Pages with ASP
    - FTP’ing Files with ASP
    - Apply Single-Sign-On to Your Application





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek