遇到 Microsoft VBScript 编译器错误 错误 '800a0408' 报错

天飓 2008-04-20 08:40:35
具体错误描述如下:
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft VBScript 编译器错误 错误 '800a0408'

无效字符

/ai/index.asp,行25

  CountFile=Server.MapPath("txtcounter.txt")


原码如下:
<%
  CountFile=Server.MapPath("txtcounter.txt")
  '文件txtcounter.txt是用来储存数字的文本文件,初始内容一般是0
  Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
  Set Out=FileObject.OpenTextFile(CountFile,1,FALSE,FALSE)
  counter=Out.ReadLine
  '读取计数器文件中的值
  Out.Close
  '关闭文件
  SET FileObject=Server.CreateObject("Scripting.FileSystemObject")
  Set Out=FileObject.CreateTextFile(CountFile,TRUE,FALSE)
  Application.lock
  '方法Application.lock禁止别的用户更改计数器的值
  counter= counter + 1
  '计数器的值增加1
  Out.WriteLine(counter)
  '把新的计数器值写入文件
  Application.unlock
  '使用方法Application.unlock后,允许别的用户更改计数器的值
  Response.Write("您是第")
  Response.Write("<font color=red>")
  Response.Write(counter)
  '把计数器的值传送到浏览器,以红(red)色显示给用户
  Response.Write("</font>")
  Response.Write("位访问者")
  Out.Close
  '关闭文件
%>

我的IIS虚拟目录为 http://localhost/ai/
...全文
733 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
天飓 2008-04-21
  • 打赏
  • 举报
回复
谢谢!
天飓 2008-04-21
  • 打赏
  • 举报
回复
谢谢!问题已解决:)
myvicy 2008-04-20
  • 打赏
  • 举报
回复
<%
CountFile=Server.MapPath("txtcounter.txt")
'文件txtcounter.txt是用来储存数字的文本文件,初始内容一般是0
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.OpenTextFile(CountFile,1,FALSE,FALSE)
counter=Out.ReadLine
'读取计数器文件中的值
Out.Close
'关闭文件
SET FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.CreateTextFile(CountFile,TRUE,FALSE)
Application.lock
'方法Application.lock禁止别的用户更改计数器的值
counter= counter + 1
'计数器的值增加1
Out.WriteLine(counter)
'把新的计数器值写入文件
Application.unlock
'使用方法Application.unlock后,允许别的用户更改计数器的值
Response.Write("您是第")
Response.Write(" <font color=red>")
Response.Write(counter)
'把计数器的值传送到浏览器,以红(red)色显示给用户
Response.Write(" </font>")
Response.Write("位访问者")
Out.Close
'关闭文件
%>
把前面的全角空格删了就好了。

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧