Statistics with FSO and SESSION statistics online number document management system V2.0

xiaoxiao2021-03-06  65

Statistics with FSO and SESSION

Document Management System V2.0 Power By: Yanhang.00

Author: yanhang Source: Yanhang.00 editors: yanhang

Rating:

All Articles - >> ASP Document - >> Code Instance Returns

Statistics with FSO and SESSION

After reading the previous article, many methods are using global.asa files. If you want to use the database, do you have a method that doesn't have a Global.asa file, don't use a database? Of course, this is what I want to use to use FSO and SESSION statistics today.

The overall idea is this: When the user accesses the page, first give the user a session, then write a message to the online.txt text file, then delete the timeout user's information, so that the current online number information. I wrote this feature into a function, as follows:

Call method: online ()

<% Function online ()

'Creating an FSO object DIM FSO SET FSO = Server.createObject ("scripting.filesystemObject")

'Define the path and file name of the record data file DIM file file = server.mappath ("Online.txt")

'Detect whether the file exists, if there is no need, new if not fso.fileexists (file) the fso.createtextfile file, true, false endiff

'Open the file, write the user IP DIM IP, TimeNow IP = Request.servervariables ("remote_addr") TimeNow = now () if session (ip) = "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " .opENTEXTFILE (File, 8, False) TXT.WRITELINE IP & "|" & TimeNow Txt.Close Set Txt = Nothing endiff

'Deleting timeout record set txt = fso.opentextfile (file, 1, false) DIM Infostring, Infoarray, I do while not txt.atendofstream infstring = txt.readline infoarray = Split (Infostring, "|", - 1, 1) IF CDATE (Infoarray (1))

End function%>

转载请注明原文地址:https://www.9cbs.com/read-119217.html

New Post(0)