Author: scholar
When you use ASP to write server applications, ActiveX is required.
Powerful Web
For example, you need to connect to the database and perform online operations on the database.
In the last two articles, the author introduced AD Rotator and Database Access.
And so on. Today, let's take a look at some other common ASP components.
I. Browser Capabilities
As we all know, not all browsers support today's Internet
All aspects of technology. Some features are supported by some browsers, but not others, such
: ActiveX controls, image streams, Dynamic HTML, Flash, and script programs. Use ASP
The Browser Capabilities component allows you to design "smart" Web
Page to display content in a format suitable for browser performance.
Browser Capabilities
The component can create a BrowserType
Object, which provides user scripts with function descriptions of the client Web browser. This component identifies the version and other information of the client browser, mainly because when the client browser sends a page request to the server, it will automatically send
User Agent HTTP title, which is an ASCII that declares the browser and its version
String.
The Browser Capabilities component maps the User Agent to the Browscap. ini file.
In the browser, and through the BrowserType
To identify the customer's browser. If the object is in browscap. ini
If no matching item is found in the file, the default browser attribute is used. If no matching item is found for this object and
Browscap. ini
If the default browser settings are not specified in the file, it sets each attribute as a string
"UNKNOWN ". By default, the browscap. ini file is stored in
WINDOWSSYSTEMINERSRV (for example, 95/98 + PWS4) or NTSYSTEM32INERSRV (for example, NT)
Directory, you can edit the text file by yourself to add your own properties or modify the file according to the latest browser version update file. See the following
CheckCookie () process, use the Cookie of the BrowserCap object
To determine whether the client browser supports cookies and return information:
<%
Sub checkCookie ()
Set BrowserCap = Server. CreateObject ("MSWC. BrowserType ")
If BrowserCap. Cookie = True then
Response. write "your browser supports cookies! "
Else
Response. write "Sorry, your browser does not support cookies! "
End if
End Sub
%>
About Browser Capabilities
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.