<Script Language="VBScript" RUNAT="Server">
Sub Application_OnStart( )
Set fs=Server.CreateObject("Scripting.FileSystemObject") counter_file=Server.MapPath("counter.txt") Set txt=fs.OpenTextFile(counter_file) Application("counter")=txt.ReadLine txt.close
Set Application("fs")=fs Application("counter_file")=counter_file End Sub
Sub Application_OnEnd( ) Set fs=Application("fs") counter_file=Application("counter_file") Set txt=fs.CreateTextFile(counter_file,true) txt.WriteLine(Application("counter")) txt.close End Sub
</Script>
<% If IsEmpty(Session("Connected")) Then Application.Lock Application_OnStart Application("counter")=Application("counter")+1 Application_OnEnd Applicaion.Unlock End If Session("Connected")=True %>
<% Function gcounter(counter) dim s,i,g s=cstr(counter) for i=0 to 10-Len(s) g=g&"<img src=img/0.jpg align=texttop>" next for i=1 to Len(s) j=mid(s,i,1) g=g&"<img src=img/"&j&".jpg align=texttop>" next gcounter=g End Function %>
<html> <title>counter</title> <head>OK</head> <body> <center><h2>访问者计数器范例——counter.asp<hr></h2> 你是本站第 <% =gcounter(Application("counter")) %> 位贵宾! </body> </html>
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
应用程序对象
不允许的对象使用
/ASP/counter.asp,行11
不能添加 apartment 型的对象到应用程序的实质对象中。 我是新手,这是书上一个示例,运行却出现这面的情况,介个办? 跪求高人指点
[此贴子已经被作者于2005-7-28 8:57:13编辑过]