How to use ASP to compile a website statistics system (2) (from gaoshan)

Source: Internet
Author: User
Tags string format
How to use ASP to compile a website statistics system (2)
1. Obtain the user's operating system.
Use the following statement in ASP to obtain the visitor's http_user_agent string.
Dim StrUserAgent
StrUserAgent = Request. ServerVariables ("HTTP_USER_AGENT ")
This string is generally in the following format:
Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
The above string indicates that the visitor uses Windows 98 and the browser uses MSIE 4.01. However, the string format is not fixed and can be changed by yourself.
The other main UserAgent strings we see are as follows:
Use the IE browser:
Mozilla/2.0 (compatible; MSIE 3.01; Windows 95)
Mozilla/4.0 (compatible; MSIE 4.0; Windows 95 );
Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
Mozilla/4.0 (compatible; MSIE 5.0; Windows 98 );
Mozilla/4.0 (compatible; MSIE 5.0b2; Windows NT)
Use the NetScape browser:
Mozilla/4.03 [en] (Win95; I)
Mozilla/4.08 [en] (WinNT; U; Nav)
Mozilla/4.5 [en] (WinNT; U)
Mozilla/3.04 Gold (Win95; I)
Use the Opera browser:
Mozilla/4.0 (compatible; Opera/3.0; Windows 95) 3.50b10
FrontPage editor:
Mozilla/2.0 (compatible; MS FrontPage 3.0)
Use the Sun Operating system:
Mozilla/3.01 Gold (X11; I; SunOS 5.7 i86pc)
Use a PowerPc Mac:
Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)
By analyzing the above strings, we can find out the rule and write a sub-program to determine the visitor's operating system. In addition, Browser needs to be updated to determine Browser-type controls in ASP. ini file, so we can use this string to determine the browser attributes.
2. How can we count websites?
We can add the following statement to the user's home page:
<A href = "http://www.abc.com/viewer.asp? Userid = username "> </a> which user is the specific userid? Note that users and visitors are not a concept.
With the above strings, we can collect user access data and provide users with links to viewing data. When we look at the page with NetEase's statistical system, we will find that it will return an icon to the user, and we can implement this function in counter. asp.
Add: response. redirect "yun_qi_img/abc.gif"
This statement can be returned to the user after statistics are collected.
The next section describes how to design the data table structure.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.