www.gusucode.com > 中网景企业网站源码时尚版 2009.73码程序 > common/counter.asp

    <%
Dim Counter
Sub IncrementCounter()
    Dim fs,counter_file,txt
	Set fs = Server.CreateObject("Scripting.FileSystemObject")
    counter_file = Server.MapPath("../common/counter.txt")

    Set txt = fs.OpenTextFile(counter_file)
    Counter = txt.ReadLine
    txt.Close

    Counter = Counter + 1


    Set txt = fs.CreateTextFile( counter_file, True )
    txt.WriteLine(Counter)
    txt.Close
    
End Sub

Application.Lock
IncrementCounter 
Application.UnLock

%>
<%=Counter%>