<% Dim Counter Sub IncrementCounter() ' 建立一 FileSystemObject 对象 Set fs = Server.CreateObject("Scripting.FileSystemObject") counter_file = Server.MapPath("counter.txt") ' 启动 /counter.txt 文件,并且读取记录在文件中的 counter 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 Function GCounter( Counter,dir ) Dim S, i, G, D D=dir S = CStr( Counter ) '先将数值转换成字符串 '逐个取字符串 S 的每个字节,然后串成 图形标记 For i = 1 to Len(S) G = G & "" Next GCounter = G End Function %> 欢迎访问北方时空—大连之星-电信资费