Hjælp med Counter
Jeg har downloaded en counder der køre asp, og i den fil står der:<%
Dim objFile, objStream
Const ForReading=1, ForWriting=2
''*******************************************************************************
'' Make sure you change the following to your servers virtual path
''*******************************************************************************
Const UsrctrPath="/counter/"
''*******************************************************************************
'' Lets open the file and read the information before we write and change
''*******************************************************************************
it
Set objFile = Server.CreateObject("Scripting.FileSystemObject")
Set objStream = objFile.OpenTextFile(Server.MapPath(UsrctrPath) &
"\counter\online.txt", ForReading, True)
strUsrCount = objStream.ReadLine
strLastTime = objStream.ReadLine
''********************************************************************************
'' Now we have the old count, lets get the new data and ready it for writing
''********************************************************************************
strCurCount = strUsrCount + 1
strCurVisit = Now()
''********************************************************************************
'' Now lets take the new data and open the file and write it
''********************************************************************************
Set objStream = objFile.OpenTextFile(Server.MapPath(UsrctrPath) &
"\counter\online.txt", ForWriting, True)
objStream.WriteLine strCurCount
objStream.WriteLine strCurVisit
''********************************************************************************
'' Close the file and tidy up a bit
''********************************************************************************
objStream.Close
Set objStream = Nothing
Set objFile = Nothing
%>
<%=strCurCount%>
<%=strLastTime%>
<html>
<head>
<title></title>
</head>
<body onunload="CloseOnline.asp">
</body>
</html>
de tilføjer et nummer til filen Online.txt
det jeg så gerne vil have lavet er at når den så åbner CloseOnline.asp så minuser den talet der står i txt filen med 1
kan det forståes ???
ellers...
når den hentet filen online.asp vil den
pludse talet der står i txt filen med 1 og når man så forlader siden der hedder CloseOnline.asp vil den minuse talet med 1
/Andreas
