Application中出现的问题

来源:百度知道 编辑:UC知道 时间:2024/06/07 23:03:51
<html>
<head><title>Application示例</title></head>
<body>
<h3>Application示例</h3>
<%
name=request.form("visitor")
i=request.form("zhuanye")
if name<>"" then
application.lock
if i=0 then
Application("chinese")=Application("chinese")+1
char="中文"
elseif i=1 then
application("english")=application("english")+1
char="英文"

end if
response.write"欢迎<b>"&name&"</b>,你是来到"
response.write"<b>"&char&"</b>讨论专区的第"
response.write application.contents(i+1)&"位客人.<p>"
response.write"<a href=9_2.asp>返回</a>"
application.unlock
response.end
end if

%>
<form method=post>
<table><tr><t

英文会变的难道?你这个 Application("chinese") 没有初始化吧?那加1会出错的。

-------------------------
2008年8月25日16:46:49

楼主输出 application 变量输出错了,既然你计数使用的是 application("chinese") 这样的方式计数的,那么你输出也要用同样的方式输出,而不能用 application(i+1) 这样的基于索引的方式,否则会有很大的不确定性。