• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

附:源代码3:BBSSENDINFO.ASP

发布: 2007-6-30 18:56 | 作者: admin | 来源: | 查看: 15次 | 进入软件测试论坛讨论

领测软件测试网 <%@ Language=VBScript %>
<%
id=trim(Request.QueryString("userid")) ‘’得到当前的用户名称,就是自己(等于Session("UserID"))
if Request.QueryString("act")="send" then ‘’获取当前的操作状态
   who=trim(Request.Form("who"))             ‘’如果是发送状态,就获取发送到的用户名称
   content=trim(Request.Form("content"))   ‘’如果是发送状态,就获取发送的内容

   if who="" or content="" then
     Response.Redirect "error.asp?msg=姓名或者讯息内容为空,无法传送!"
   end if
   ‘’因为&,$是传呼信息区的分割符号,所以要过滤掉这些字符,不允许用户输入这些字符
   if instr(1,who,"&")>=1 or instr(1,who,"$")>=1 or instr(1,content,"&")>=1 or instr(1,content,"$")>=1 then
     Response.Redirect "error.asp?msg=姓名或者讯息内容包含非法字符($/&),无法传送!"
   end if
   
   if trim(application("Message"))="" then
     Application.Lock    ‘’将传呼信息放到传呼信息队列当中
     application("Message")=who & "$" & content & "$" &  trim(Request.QueryString("userid"))
     Application.UnLock
   else
     Application.Lock   ‘’将传呼信息放到传呼信息队列当中
     application("Message")="&" & who & "$" & content & "$" &  trim(Request.QueryString("userid"))
     Application.UnLock
   end if

   Response.Write "<script language=javascript>self.close()</script>"
   Response.End
else   
‘’**************************
‘’开始分析处理"传呼信息队列",取得属于自己的传呼信息
  if trim(application("Message"))<>"" then
     msg=split(application("Message"),"&")  ‘’分割得到传呼信息区,并保存到数组
     for i=0 to ubound(msg)
       if instr(1,trim(msg(i)),trim(Request.QueryString("userid")))>=1 then
         mymsg=split(msg(i),"$")  ‘’分割得到每个传呼信息区的详细信息
         if trim(mymsg(0))=trim(Request.QueryString("userid")) then ‘’这条传呼信息是发给我的!
            msgok=1    ‘’有人呼叫我的表记置为1
            from=trim(mymsg(2)) ‘’获得传呼的详细内容
            content=trim(mymsg(1))
            sendto=trim(mymsg(0))
         end if
       end if
     next
end if
‘’****************************
end if
%>
<html>
<title>网络传呼机</title>
<head>
<script language="javascript">
function nosend()
{
document.frmmail.action="bbsSendInfo.asp?act=wait&userid=<%=trim(Request.QueryString("userid"))%>"
  document.frmmail.submit();
}
function meclose()
{
document.frmmail.action="bbsSendInfo.asp?act=closeme&userid=<%=session("userid")%>"
  document.frmmail.submit();
}
function destory()
{
<% if trim(request("act"))="closeme" then
   cancelme=trim(Request.QueryString("userid")) & "$" & content & "$" & trim(from)
   application.lock
   application("Message")=replace(application("Message"),cancelme,"")
   application.unlock %>
   self.close()
<% end if%>
}
function chkok()
{
  if (document.frmmail.content.value=="")
  {
    alert("您不能说\"空话\"喔!");
    return;
  }
document.frmmail.submit();  
}
</script>
</head>
<body bgcolor="GhostWhite" onload="javascript:destory();" topmargin="0">
<br>
<form name="frmmail" action="bbsSendInfo.asp?act=send&userid=<%=trim(Request.QueryString("userid"))%>" method="post">
<table border="0" width="200" align="center" cellspacing="1" cellpadding="1">
  <tr>
    <td colspan="2" align="center">嘻嘻,有人呼你喔...
  </tr>
  <tr>
    <td colspan="2"> </td>
  </tr>
  <tr>
    <td nowrap><%=from%>说:</td>
    <td><%=content%></td>
  </tr>
  <tr>
    <td nowrap>回覆内容:</td>
    <td><input name="content" size="34" maxlength="35"></td>
  </tr>
</table>
<br><br>
<center>
<a href="javascript:chkok();"><img src="send.gif" border="0"></a>
<a href="javascript:document.frmmail.reset()"><img src="renew.gif" border="0"></a>
<a href="javascript:meclose();"><img src="exit.gif" border="0"></a>
<input name="who" type="hidden" value="<%=from%>">
</center>
</body>
</html>

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网