several large extensible components of ASP (ii)
Last time we talked about how to use the browser performance component (Browser capabilities Component), this article goes back to how to write or upgrade Browsercap.ini files.
Browscap.ini File
You can describe the properties of any number of browsers in the Browscap.ini file. You can also set default properties, and the browser type (Browertype) object assumes that the browser has a default property when the header sent by the browser cannot match any of the entries in the Browscap.ini.
Each browser definition consists of an HTTP header, some property names, and related property values. The definitions of HTTP headers for various browsers refer to the contents of the [Link]http://www.w3.org/[/link] Web site.
Grammar
[; comments]
[HTTPUserAgentHeader]
[parent = Browserdefinition]
[property1 = value1]
...
[Propertyn = Valuen]
[Default Browser Capability Settings]
[defaultProperty1 = defaultValue1]
...
[Defaultpropertyn = Defaultvaluen]
Parameters
Comments
Any of several lines that begin with a comment;
HTTPUserAgentHeader
HTTP User Agent header, similar to the following format [mozilla/2.0 (compatible; MSIE 3.0;* Windows 95)], where you can use the wildcard character *.
Browserdefinition
The HTTP header used to define the parent class
Propertyn
Property name of the browser, you can select the desired property from the list of properties (see Appendix for a detailed list)
Valuen
The browser's property value
Defaultpropertyn
Default Browser property name, optional properties with Propertyn
Defaultvaluen
Property values for the default browser
Example
;; IE 4.0
[IE 4.0]
Browser=ie
version=4.0
Frames=true
Tables=true
Cookies=true
Backgroundsounds=true
Vbscript=true
Javascript=true
Javaapplets=true
Activexcontrols=true
Beta=false
;; IE 4.01
[Mozilla/2.0 (compatible; MSIE 4.01*; Windows 95)]
Parent=ie 4.0
version=4.01
Minorver=01
Platform=win95
; Default Browser
[Default Browser Capability Settings]
Browser=default
Frames=false
Tables=true
Cookies=false
Backgroundsounds=false
Vbscript=false
Javascript=false
Appendix-List of browser properties
Property name Description
ACTIVEXCONTROLS Specifies whether the browser supports ActiveX controls
BACKGROUNDSOUNDS Specifies whether the browser supports background music
BETA Specifies whether the browser is a beta version
browser specifies the name of the browser
CDF Specifies whether the browser supports channel interpretation definitions for Web publishing (Channel definition Format)
Cookies Specify whether the browser supports cookies
frames Specifies whether the browser supports frame display
JAVAAPPLETS Specifies whether the browser supports Java applets
JavaScript Specifies whether the browser supports JavaScript
platform specifies the operating system required for the browser to run
Tables Specify whether the browser supports tables
VBScript Specifies whether the browser supports VBScript
version specifies the browser versions
Note: The above explanation is "Specify whether browser supports" property whose property value should be true/false and the remainder as String