Support & FAQ
Support & FAQ
 
 

Support & FAQ

Spørgsmål:

Simpel ASP tæller

Svar:

Eksemplet nedenfor viser hvordan en simpel tæller kan laves i ASP. Antallet af besøgende gemmes i "/log/Counter.log".

Download eksempel: Counter.zip
 

<html>
<head>
  <title>ASP Counter</title>
</head>
<body bgcolor="#FFFFFF">

<%
Set fs = CreateObject("Scripting.FileSystemObject")
LogFile = Server.MapPath("log/Counter.log")
Set rf = fs.OpenTextFile(LogFile, 1, False)
LastCount = rf.ReadLine
Count = LastCount + 1
Set wf = fs.OpenTextFile(LogFile, 2, True)
wf.WriteLine(Count)
wf.Close
rf.Close
Set wf = nothing
Set rf = nothing
Set fs = Nothing
%>

<p><%=Count%></p>

</body>
</html>

 



Hvordan ville du karakteriserer dette indhold (hvor 5 er bedst)?


Senest opdateret: 08-04-2008, 13:28.
A/S ScanNet - Birkemose Allé 11 - 6000 Kolding - Tlf. (+45) 75 53 35 00 - Fax (+45) 75 53 35 09 - scannet@scannet.dk