% Set conn= Server.CreateObject("ADODB.Connection") dbpath= "driver={Microsoft Access Driver (*.mdb)};" conn.Open= dbpath & ";dbq=" & Server.MapPath("data.mdb") Dim Counter Sub IncrementCounter() Set fs = Server.CreateObject("Scripting.FileSystemObject") counter_file = Server.MapPath("counter.txt") Set txt = fs.OpenTextFile( counter_file ) Counter = txt.ReadLine txt.Close Counter = Counter +1 ' 将计数器写入 /counter.txt 文件之中 Set txt = fs.CreateTextFile( counter_file, True ) txt.WriteLine(Counter) txt.Close End Sub Application.Lock IncrementCounter ' 将访问者计数器加一,并写入文件中 Application.UnLock %>