代码如下:
<%response.expires=0
response.buffer=true%>
Chat sample
我的聊天室
<% if request.servervariables("request_method")="POST" then
if len(request("txtname"))>0 then
session("ssname")=request("txtname")
end if
application.lock
mcounter=application("gcounter")
mchars=application("gchars")
if mcounter>9 then
mcounter=0
end if
mchars(mcounter)=session("ssname") & ":" & request("txttalk")
mcounter=mcounter+1
application("gcounter")=mcounter
application("gchars")=mchars
application.unlock
end if %>
<% if application("gcounter")="0" then
lstemp=application("gchars")(0)
else
for x=0 to application("gcounter")-1
lstemp=lstemp & "
" & application("gchars")(x)
next
end if
response.write lstemp %>
表单提交后出现错误,提示:
错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: 'mchars'
/asp/chatexample.asp, 第 16 行
到底错在哪里,怎么改?还有,中间Application.Lock和Application.Unlock之间为什么要那样写,可以改简单一点吗?
我很菜的,刚学ASP不久,希望各位大虾不吝指教,谢谢!