SunQuest
 
       ASP
  Home arrow ASP arrow Microsoft Browser Capabilities Component
Iron Speed
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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

Microsoft Browser Capabilities Component
By: Steve Schofield
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    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

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    The Browser Capabilities component creates a BrowserType object that provides your scripts with a description of the capabilities of the client's Web browser.

     

    The Browser Capabilities component creates a BrowserType object that provides your scripts with a description of the capabilities of the client's Web browser.

    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 BrowserType object compares the header to entries in the Browscap.ini file.

    If it finds a match, the BrowserType object assumes the properties of the browser listing that matched the User Agent header.

    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."

    You can add properties or new browser definitions to this component simply by updating the Browscap.ini file.

    File Names
    Browscap.dllThe Browser Capabilities component.
    Browscap.iniA text file that maps browser capabilities to the HTTP User Agent header. This file must be in the same directory as Browscap.dll.

    Syntax

    Set BrowserType = Server.CreateObject("MSWC.BrowserType")

    Parameters
    BrowserType
    Specifies the name of the BrowserType object created by the call to Server.CreateObject.
    Example

    The following example uses the BrowserType object to display a table showing some of the capabilities of the current browser.

    <%  Set bc = Server.CreateObject("MSWC.BrowserType") %>  
    <TABLE BORDER=1> 
    <TR><TD>Browser</TD><TD>  <%= bc.browser  %>  
    <TR><TD>Version</TD><TD>  <%= bc.version  %>  </TD></TR> 
    <TR><TD>Frames</TD><TD>
    <%  if (bc.frames = TRUE) then  %>  TRUE
    <%  else  %>  FALSE
    <%  end if  %> </td></TR> 
    <TR><TD>Tables</TD><TD>
    <%  if (bc.tables = TRUE) then  %>  TRUE 
    <%  else  %> FALSE
    <%  end if  %> </TD></TR> 
    <TR><TD>BackgroundSounds</TD><TD> 
    <%  if (bc.BackgroundSounds = TRUE) then  %>  TRUE 
    <%  else  %> FALSE
    <%  end if  %> </TD></TR> 
    <TR><TD>VBScript</TD><TD> 
    <%  if (bc.vbscript = TRUE) then  %>  TRUE 
    <%  else  %> FALSE
    <%  end if  %> </TD></TR> 
    <TR><TD>JScript</TD><TD> 
    <%  if (bc.javascript = TRUE) then  %>  TRUE 
    <%  else  %> FALSE
    <%  end if  %> </TD></TR> 
    </TABLE>

    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! Download the free Web Application Security eKit

    Discover how IBM Rational AppScan Standard Edition can help you detext vulnerabilities in your web applications in the Web Application Security eKit. IBM Rational AppScan is a leading suite of automated web application security solutions that scan and test for common Web application vulnerabilities. The new Web Application Security eKit provides you with valuable resources, including white papers, demos, and additional information on the benefits of testing your Web applications.
    FREE! Go There Now!


    NEW! Evaluate IBM Rational Software Analyzer V7.0

    Download a free trial version of IBM Rational Software Analyzer Developer Edition V7.0 to identify bug defects earlier in the software development cycle. Rational Software Analyzer is an extensible software development solution that reduces the expense of bug-fixes by enabling static analysis code reviews and bug identification very early in the development cycle.
    FREE! Go There Now!


    NEW! Project and Portfolio Management Executive Resource Kit

    Portfolio Management is about effectively managing portfolio value by aligning portfolio investments with business goals. This complimentary e-kit provides a collection of materials that can help you understand how IBM Rational enables and automates best practices for improved governance and clear visibility into portfolio and project performance across the entire IT project lifecycle.
    FREE! Go There Now!


    NEW! Section 508 of the U.S. Rehabilitation Act: Web accessibility compliance

    Because access to government information continues to be an area of concern for many U.S. citizens with disabilities, the U.S. government enacted Section 508 of the Rehabilitation Act in 2001 to ensure that government agencies create accessible Web content, enabling all citizens to access the information they need. A fully accessible Web site makes Web content accessible to all individuals, including those with disabilities, who may be accessing Web content via a variety of user agents. Common user agents include standard Web browsers, text-only browsers, assistive devices and mobile devices such as cell phones or personal digital assistants (PDAs).
    FREE! Go There Now!


    NEW! Trial download: IBM Rational Method Composer V7.2

    Get a free trial download of the latest version of IBM Rational Method Composer V7.2 which helps you deliver customized yet consistent process guidance to your project teams and IT organization, and includes the latest version of IBM Rational Unified Process (RUP), which has provided process guidance to teams since 1996.
    FREE! Go There Now!


    NEW! Trial download: IBM Rational Performance Tester V7.0.1

    Get a free trial download of the latest version of IBM Rational Performance Tester V7.0.1, a load and performance testing solution for teams concerned about the scalability of their Web-based applications. Combining multiple ease-of-use features with granular detail, Rational Performance Tester simplifies the test-creation, load-generation and data-collection processes that help teams ensure the ability of their applications to accommodate required user loads.
    FREE! Go There Now!


    NEW! Using IBM Rational Developer for System z and IBM Rational ClearCase together to manage application development

    Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes.
    FREE! Go There Now!


    NEW! Webcast: Calling All Testers! Find Application Vulnerabilities Early in the Development Process Where they are Easier to Fix and Less Risky to your Business

    In this webcast, IBM Rational will discuss the importance of Web application security and will share techniques and best practices to introduce application security testing into current QA processes including: understanding common security vulnerabilities and techniques to integrate security testing with defect tracking and remediation systems in an effort to safeguard sensitive online information.
    FREE! Go There Now!


    NEW! Webcast: Quickly provide customized, integrated user interfaces with Lotus Notes 8

    IBM Lotus Notes 8 provides a wide range of developers the ability to provide customized, integrated user interfaces via composite applications and via custom sidebar and toolbar plug-ins. This webcast provides you with tips and techniques to use with out-of-the-box capabilities of Lotus Notes 8, and survey how you can share useful components within your own company and within a larger community.
    FREE! Go There Now!


    NEW! Webcast: Striking the right balance between manual and automated testing

    Join this webcast to learn how IBM Rational's Functional Testing solution enables you to implement automation your way, at your pace, with your existing staff. In this webcast, you’ll learn how you can eliminate redundancy of manual test scripts, reduce errors, and increase test coverage through test automation. After this presentation you will understand how IBM Rational Functional Testing solution can streamline your manual testing and make test automation easily attainable.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    ASP ARTICLES

    - 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
    - Easy Error Management

    Iron Speed




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway