每次第一次运行出现 错误,刷新一下页面就OK了,怎么回事??
源代码:
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=gb_2312-80">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<title></title>
</head>
<body>
<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
' 将FileSystemObject对象及counter.txt的实际路径
' 保存Application对象中
Set Application("fs") = fs
Application("counter_file") = counter_file
txt.Close
End Sub
Sub Application_OnEnd
' 将保存在 Application 对象中 FileSystemObject 对象
' 及counter.txt 的实际路径读出来
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>
</body>
</html>
错误提示:
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
应用程序对象 错误 'ASP 0197 : 80004005'
不允许的对象使用
//global.asa,行21
不能添加 apartment 型的对象到应用程序的实质对象中。
每次第一次浏览时就会出现这些错误提示,但是刷新一下页面,第二次就能正常运行了。不知道是怎么回事???