Count. asp
<Html>
<Head>
<Meta http-equiv = "Content-Type"
Content = "text/html; charset = gb2312">
<Title> Thousands of changes in the Wind </Title>
</Head>
<Body>
<P>
<%
Dim out
Countfile = server. mappath ("aspcount.txt ")
Set objfile = server. createobject ("scripting. filesystemobject ")
'Define a server component.
Set out = objfile. opentextfile (countfile, 1, false, false)
Counter = out. readline
'Read data.
Out. close
Set objfile = server. createobject ("scripting. filesystemobject ")
Set out = objfile. createtextfile (countfile, trUE, FALSE)
Application. lock
'Temporarily locked.
Counter = counter + 1
'Visitor Count Plus1.
Out. writeline (counter)
'Write Data.
Application. unlock
'Unlock.
Out. close
%>
<Script language = "javascript">
Function countdisp (countvar ){
Var countvar1 = "000000" + countvar;
'Achieve random display,Insufficient6Bitwise0Completion.
Var howFar1 = countvar1.length;
Countvar1 = countvar1.substring (howfar1. howFar1-1)
Var index = "" + Math. floor (Math. random () * 10 );
If (index = "10 "){
Index = "0 "};
For (var icount = 0; icount<6; icount ++={
Var g = countvar1.substring (icount, icount + 1 );
Document. images [icount]. src = "http ://
Localhost/images/"+ index + g +". gif ";
}
=
</Script> </P>
<! --Pre-loaded image Array-->
You areImg src = "http: // localhost/images/00.gif" height = 20 width = 20>
<Img src = "http: // localhost/images/00.gif" height = 20 width = 20>
<Img src = "http: // localhost/images/00.gif" height = 20 width = 20>
<Img src = "http: // localhost/images/00.gif" height = 20 width = 20>
<Img src = "http: // localhost/images/00.gif" height = 20 width = 20>
<Img src = "http: // localhost/images/00.gif" height = 20 width = 20> Visitor!
<Script language = "javascript">
Count (counter );
' Call Count () Function , Achieve dynamic display of counters .
< /Script >
< /Body >
< /Html >
[1]