Tutorials to .com

Tutorials to .com » Asp » Skills » How to write ASP Web Statistics System 2

How to write ASP Web Statistics System 2

Print View , by: iSee ,Total views: 23 ,Word Count: 509 ,Date: Sun, 23 Aug 2009 Time: 9:59 PM

1. To obtain the user's operating system.
Use the following statement in the asp can get visitors http_user_agent string.
Dim StrUserAgent
StrUserAgent = Request.ServerVariables ( "HTTP_USER_AGENT")
This string is generally the following format:
Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
The above illustrates the string used by the visitor's operating system is Windows98, browser, MSIE 4.01, but this string format is not fixed, and can change themselves.
Usually we have seen a number of other major UserAgent string is as follows:
Using 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)
Using NetScape browsers:
Mozilla/4.03 [en] (Win95; I)
Mozilla/4.08 [en] (WinNT; U; Nav)
Mozilla/4.5 [en] (WinNT; U)
Mozilla/3.04Gold (Win95; I)
The use of Opera's browser:
Mozilla/4.0 (compatible; Opera/3.0; Windows 95) 3.50b10
FrontPage Editor:
Mozilla/2.0 (compatible; MS frontpage 3.0)
Using the Sun Operating System:
Mozilla/3.01Gold (X11; I; SunOS 5.7 i86pc)
Use PowerPc a mac machine:
Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)
By analyzing the above string, we can find the rules, write a subroutine to determine what type of operating system used by visitors, but also due to use ASP to determine the type of browser controls need to be updated Browser.ini files, so we can combination of this string to determine the browser properties.
2. We are in what way to statistics site?
We can allow users to add in his home the following statement:
<a href="http://www.abc.com/viewer.asp?userid=username"> <img src="http://www.abc.com/counter.asp?userid=username"> </ a>
Above which a userid is a specific user, should pay attention to users and visitors not concept.
Through the above string we can capture the user's access to data and give users viewing the data link. As we look at the additions and Netease page statistical systems will find that it will return to the user an icon, we can implement this functionality in counter.asp.
Add: response.redirect "http://www.abc.com/abc.gif"
This statement can be added to the statistical data collection and returned to the user.
Next talk is how to design data table structure.


ASP skills Articles


Can't Find What You're Looking For?


Rating: 0.0

Comments

No comments posted.