新菜鸟新问题,请高手帮我看一下程序!!!
我刚学ASP不久,自己弄了个留言板,运行时第51行出现类型不匹配错误,自己看了半天也没觉得有什么不对
请各位高手帮我看一下程序,是不是有什么地方编错了,谢谢!
有两个文件:Global.asa和AspChat.asp
Global.asa代码:
<Script language="VBScript" runat="server">
Sub Application_OnStart
Dim maChats(15)
Application("gaChats")=maChats
Application("giCounter")=0
End Sub
</Script>
AspChat.asp代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body {
background-color: #0099CC;
}
.tit {
font-family: "隶书";
font-size: 36px;
color: #336666;
text-align: center;
}
.frm {
font-family: "宋体";
font-size: 18px;
color: #000000;
text-align: center;
}
-->
</style>
</head>
<!--#include file="Global.asa"-->
<body class="tit">
<p>网上留言板</p>
<hr align="center" size="1" noshade>
<% If request.ServerVariables("REQUEST_METHOD")="post" Then
if len(request("txtWho"))>0 then
session("ssWho")=request("txtWho")
end if
application.Lock()
mlCounter=Application("giCounter")
maChats=Application("gaChats")
if mlCounter>9 then
mlCounter=0
end if
maChats(mlCounter)= session("ssWho")&":"& request("txtCents")
mlCounter=mlCounter+1
application("giCounter")=mlCounter
Application("gaChats")=maChats
Application.UnLock()
End If %>
<% 'dim lstemp
if application("giCounter")=0 then
lstemp=Application("gaChats")(0)
else
for x=0 to application("giCounter")-1
lstemp=lstemp&"<br>"&Application("gaChats")(x)
next
end if
Response.Write lstemp
%>
<hr size="1" noshade>
<form action="AspChat.asp" method="post" name="frmasp" id="frmasp">
<table width="94%" border="1" cellspacing="0" cellpadding="0" bordercolor="#336699">
<tr align="center" bgcolor="#FFFFCC">
<td width="22%" class="frm">留言内容</td>
<td width="78%">
<textarea name="txtCents" cols="50" id="txtCents"></textarea></td>
</tr>
<tr bgcolor="#CCFF99">
<td align="center" class="frm">留言者姓名</td>
<td>
<input name="txtWho" type="text" id="txtWho" value="<%=Session("ssWho") %>" size="40"> </td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="28" colspan="2" align="center" class="frm"><input type="submit" name="Submit" value="提交留言信息"></td>
</tr>
</table>
</form>
</body>
</html>