ASP Browser Component Instance Tutorial

Source: Internet
Author: User

ASP Browser Component Instance Tutorial

ASP components for Browser capabilities
The browser features an ASP component to create a BrowserType object that determines the type, functionality and version number of each browser to access your site.

When the browser is connected to a server, an HTTP user Agent header is also sent to the server. This header contains information about browsers (such as browser type and version number). The BrowserType object then compares the information in the information with the message header in a file on the server called "Browscap.ini".

If there is a match between the browser type and the version number sent by the title and information of the "Browsercap.ini" file, you can use the BrowserType object to list the properties that match the browser. If there is no matching browser type and version number of the Browscap.ini file, each set of property "Unknown".

Grammar

<%
Set mybrow=server.createobject ("MSWC. BrowserType ")
%>

The following example creates a BrowserType object in an ASP file and displays a table listing some features in the current browser:

 
  
<%
Set mybrow=server.createobject ("MSWC. BrowserType ")
%>
<table border= "1" width= "100%" > <tr> <th>client os</th> <th><%=MyBrow.platform%>
</th> </tr><tr> <td >web browser</td> <td ><%=MyBrow.browser%></td> </tr><tr> <td>browser version</td> <td><%=MyBrow.version%></td> </tr ><tr> <td>frame support?</td> <td><%=MyBrow.frames%></td> </tr><tr > <td>table support?</td> <td><%=MyBrow.tables%></td> </tr><tr> <td >sound support?</td> <td><%=MyBrow.backgroundsounds%></td> </tr><tr> <td >cookies support?</td> <td><%=MyBrow.cookies%></td> </tr><tr> <td> VBScript support?</td> <td><%=MyBrow.vbscript%></td> </tr><tr> <td> JavaScript support?</td> <td><%=MyBrow.javascript%></td> </tr>% 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.