% '' Stat count Application.Lock '' Create fso object Set fso = Server.CreateObject("Scripting.FileSystemObject") '' Open file for reading Set f = fso.OpenTextFile(Server.Mappath("/stat.txt"), 1, True) '' Read if not f.AtEndOfStream stat = f.readline '' Close after read f.close else stat = 0 end if '' Close file Set f = nothing '' Calculate stat = (int(stat) + 1) '' Open file for writing Set f = fso.OpenTextFile(Server.Mappath("/stat.txt"), 2, True) '' Write down data f.write stat '' Close file and destroy object f.close Set f = nothing Set fso = nothing Application.UnLock %>
![]() |
|||||
![]() |
|||||