注册 | 登录 | 设为首页 | 加入收藏
您当前的位置:飞翔学院-IT中国 → 编程开发Asp → 文章内容

用ASP实现聊天室中的在线答题游戏(续)

作者:IT 来源:不详 发布时间:2007-9-2 0:49:50
答案处理部分,放在处理发送对话信息的程序中即可。下面是答案处理的代码部分:

if mid(FStr,i,1)="#" then 'FStr是保存对话信息的字符串变量
TFstr=mid(FStr,i+1,1)
if CInt(DateDiff("n",application("questionTime"),Now()))<=1 then '判断时间1分钟内答题有效
if LCase(TFstr)=LCase(application("answerTrue")) then '判断答题是否正确
if instr(1,application("answerName"),session("USER_USERNAME"))>0 then '判断用户是否已经答过题了
TFstr=session("USER_USERNAME")&"已经答过这道了!!!"
else
TFstr=session("USER_USERNAME")&"答题正确!"
Session("USER_EXP") =Session("USER_EXP")+application("questionCent") '给答对题的用户加分
application("answerName")=application("answerName")&session("USER_USERNAME")&" " '保存答对题用户的名字
end if
else
if instr(1,application("TanswerName"),session("USER_USERNAME"))>0 then ''判断用户是否已经答过题了

TFstr=session("USER_USERNAME")&"已经答过这道了!!!"
else
application("TanswerName")=application("TanswerName")&session("USER_USERNAME")&" " '保存答错题用户的名字
end if
end if
end if

http://www.itcnw.com/
  • 打印文档
  • 推荐好友
  • 返回顶部
  • 增大字体
  • 减少字体
关于本站 | 工作机会 | 合作网站 | 广告服务 | 市场合作| 联系我们 | 抽奖活动
版权所有: 武汉威俊科技有限公司 Copyright 2005-2007 www.ITCNW.COM All rights reserved