FLASH中:
第一帧:
loadVariables("count_access/count.asp","","post")
第二十帧:
if (count<>undefined) {
mess = ",您是第"+count+"位访客";
} else {
mess = ",您是第0位访客";
}
count.asp的内容:
<%
CountFile=Server.MapPath("count.txt")
'文件simplecounter.txt是用来储存数字的文本文件,初始内容一般是0
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.OpenTextFile(CountFile,1,FALSE,FALSE)
counter=Out.ReadLine
'读取计数器文件中的值
Out.Close
'关闭文件
SET FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.CreateTextFile(CountFile,TRUE,FALSE)
Application.lock
'方法Application.lock禁止别的用户更改计数器的值
counter= counter + 1
'计数器的值增加1
Out.WriteLine(counter)
'把新的计数器值写入文件
Application.unlock
'使用方法Application.unlock后,允许别的用户更改计数器的值
Response.Write"count="&counter
Out.Close
%>
第一帧:
loadVariables("count_access/count.asp","","post")
第二十帧:
if (count<>undefined) {
mess = ",您是第"+count+"位访客";
} else {
mess = ",您是第0位访客";
}
count.asp的内容:
<%
CountFile=Server.MapPath("count.txt")
'文件simplecounter.txt是用来储存数字的文本文件,初始内容一般是0
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.OpenTextFile(CountFile,1,FALSE,FALSE)
counter=Out.ReadLine
'读取计数器文件中的值
Out.Close
'关闭文件
SET FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.CreateTextFile(CountFile,TRUE,FALSE)
Application.lock
'方法Application.lock禁止别的用户更改计数器的值
counter= counter + 1
'计数器的值增加1
Out.WriteLine(counter)
'把新的计数器值写入文件
Application.unlock
'使用方法Application.unlock后,允许别的用户更改计数器的值
Response.Write"count="&counter
Out.Close
%>
回复Comments
作者:
{commentrecontent}