Tæller i asp
Jeg har et tæller script men hvergang jeg prøver at køre det via explore får jeg en fejlmeddelse. Jeg har PWS og har også indstillet det rigtigt men det er en fejl i selve scriptet. Herunder er scriptet jeg håber der er nogen der kan hjælpe mig.-------------------Start script-------------------
<%
Dim objFile, objStream
Const ForReading=1, ForWriting=2
' Make sure you change the following to your servers virtual path
Const UsrctrPath="/dan/asp"
' Lets open the file and read the information before we write and change
it
Set objFile = Server.CreateObject("Scripting.FileSystem.Object")
Set objStream = objFile.OpenTextFile(Server.MapPath(UsrctrPath) &
"counter.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.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>
</body>
</html>
-------------------Slut script-------------------
