<%@ LANGUAGE="VBScript" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%

   Const ForReading   = 1
   Const ForWriting   = 2
   Const ForAppending = 8

   path = Server.MapPath("/fpdb/counter.txt")
%> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <META NAME="GENERATOR" Content="Microsoft FrontPage 6.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>textcounter</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <link rel="stylesheet" type="text/css" href="/common/default.css" /> </HEAD> <BODY> <% Dim CounterHits, fs, file set fs = CreateObject("Scripting.FileSystemObject") set file = fs.OpenTextFile(path, ForReading) If Not file.AtEndOfStream Then CounterHits = Trim(file.ReadLine) If CounterHits = "" Then CounterHits = 0 file.Close() CounterHits = CounterHits + 1 '================= Write ================== set file = fs.OpenTextFile(path, ForWriting) file.WriteLine(CounterHits) file.Close() Set fs = Nothing %> <% =CounterHits %><br><br> </BODY> </HTML>