| 1.一個(gè)asp文件,一個(gè)計數的count.txt文件 asp文件 ========== <% CountFile=Server.MapPath("count.txt") 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 counter= counter + 1 Out.WriteLine(counter) Application.unlock Response.Write"您是第"&counter&"位訪(fǎng)客" Out.Close %> ========== 保存為count.asp,同目錄下放一文本文件count.txt,初始數值為任意數字 2.在需要計數的網(wǎng)頁(yè)加入: <script language="JavaScript" src="http://。。。。。。/count.asp"></script> |
聯(lián)系客服