⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queryresult.asp

📁 电脑技术精华大全-共77册-507M.zip
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<%option explicit%>
<!--#include file="newconn.asp"-->
<!-- #include file="inc/char.inc" -->
<!-- #include file="inc/chkstr.inc"-->
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb_2312-80">
<meta HTTP-EQUIV="Expires" CONTENT="0">
<link rel="stylesheet" type="text/css" href="forum.css">
<title>查 询 结 果</title>
</head>
<body >
<%   
   dim sql,rs

   dim itype 
   dim topic
   dim UserName
   dim bID
   dim boardtype
   dim iroot
   dim t
   dim bytestr

   bID=0
   itype=request("type")
   if request("selBoard")<>"" then bID=request("selBoard")
   if iis3onchsys=true then
      topic=HTMLCharacter(trim(request("txtTopic")))
   else
      topic=trim(request("txtTopic"))
   end if
   if iis3onchsys=true then
      UserName=HTMLCharacter(trim(request("txtUser")))
   else
      Username=trim(request("txtUser"))
   end if
   sql="select Boardtype from board where boardID="&cstr(bID)
   set rs=server.createobject("adodb.recordset")
   rs.open sql,conn,1,1
   if not (rs.bof and rs.eof) then
      boardtype=rs(0)
   end if
   rs.close
   response.write "<strong>"&boardtype&"</strong>"
response.write "  <a href='Announce.asp?boardID="&bid&"' target="+chr(34)+"BoardAnnounce"+chr(34)+">我要发言</a> <a href='List.asp?boardID="&bid&"'>刷新浏览</a> <br>"+chr(13)+chr(10)
   if (trim(topic)=""  and trim(UserName)="") OR BID=0 then 
	     response.write "<center><big>没有输入查询条件。:o(</big></center>"+chr(13)+chr(10)
   else
	  select case itype
          case 1
  		      sql="select * from bbs1 where (topic like '%"&checkStr(topic)&"%') and boardID="&cstr(bID)&" ORDER BY announceID desc "
		  case 2
		      sql="select * from bbs1 where (username='"&checkStr(UserName)&"') and boardID="&cstr(bID)&" ORDER BY announceID desc "
       end select 
       rs.open sql,conn,1,1
       if rs.eof and rs.bof then
         response.write "<center><big>没有找到。:o(</big></center>"+chr(13)+chr(10)	
        else
         '------------------------------------------------------------------------
         response.write " 查询结果,找到 "&cstr(rs.recordcount)+chr(13)+chr(10)
	     response.write "<ul>"+chr(13)+chr(10)
	     rs.movefirst
	     do while not rs.eof
   response.write "<li>"
		    dim newimgstr
            newimgstr=""
            if trim(rs("dateandtime"))<>"" and isdate(rs("dateandtime")) then
		       if cbool(cdate(rs("dateandtime"))>(date()-1))=true then
                  newimgstr="<img src='images/"&rs("Expression")&"' border=0>"+chr(13)+chr(10)
               end if
	    	   response.write newimgstr
			   iroot=rs("rootID")
			   if rs("rootID")=0 then iroot=rs("announceID")
			      rem response.write iroot
                  response.write " <a href='ShowAnnounce.asp?boardID="&cstr(rs("BoardID"))&"&RootID="&cstr(iroot)&"&ID="&Cstr(rs("AnnounceID"))&"' target='BoardAnnounce'>"
	  if rs("Length")=0 then
	     t=" <无内容>"
          else 
             t=" "
	  end if		   
         
                  if pwsonchsys then
	                 showBody rs("Topic")+t
                  else
                     response.write Server.HTMLEncode(rs("Topic")+t)
                  end if
          bytestr="("+cstr(rs("length"))
          if not WINNT_CHINESE then
             if rs(Length)-1=1 then
                bytestr=bytestr+" Byte)"
	     else
	        bytestr=bytestr+" Bytes)"
      	     end if
          else 
             bytestr=bytestr+"字)"
          end if
			      response.write "</a> - <strong>" 
                  if pwsonchsys then
                     showBody rs("UserName")
                  else
                     response.write Server.HTMLEncode(rs("UserName")) 
                  end if
                  response.write " </strong><em><font color='red'>"+ rs("dateAndTime")+"</font></em> " +"<font color='darkblue'>[ID:"+cstr(rs("announceID"))+" 点击:"+cstr(rs("hits"))+"]</font> " + bytestr + " <font color='red'>(" + Cstr(rs("child"))+")</font>"+chr(13)+chr(10)
		        end if
	 if trim(rs("DateAndTime"))<>"" and isdate(rs("DateAndTime")) then
             if cbool(cdate(rs("DateAndTime"))>(date()-1))=true then
                response.write  "<img src='images/new.gif'>"+chr(13)+chr(10)
             end if
          end if
		        response.write "</li>"+chr(13)+chr(10)
	            rs.movenext
	        loop
	     response.write "</ul>"+chr(13)+chr(10)
      end if
      rs.close
   end if
   
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -