Hello ASP.NET
I'm using this solution I found to count page hits.
This was working fine, but I guess my hosting limited access to this path.
Can someone help me with a new path for the counter.txt file?
Try
sFile = Server.MapPath(".")
If Right(sFile, 1) <> "\" Then sFile = sFile & "\"
sFile = sFile & "counter.txt"
If Not File.Exists(sFile) Then
objWriter = File.CreateText(sFile)
objWriter.Write("0")
objWriter.Close()
End If
objReader = File.OpenText(sFile)
sCount = objReader.ReadToEnd()
objReader.Close()
iCount = CInt(sCount)
iCount = iCount + 1
sCount = iCount.ToString
objWriter = File.CreateText(sFile)
objWriter.Write(sCount)
...
Go to the complete details ...