欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

編程問答

當前位置:主頁 > 網(wǎng)絡編程 > 編程問答 >

如何實現(xiàn)全文檢索?

來源:本站原創(chuàng)|時間:2020-01-11|欄目:編程問答|點擊: 次

<%@ LANGUAGE="VBscript" %>
  <html>
  <head>
  <meta NAME="GENERATOR" Content="Microsoft FrontPage 3.0">
  <meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb_2312-80">
  <title>星河影動之全文檢索</title>
  <meta name="Microsoft Border" content="tl, default"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

</head>
   <body BGPROPERTIES="FIXED" BGCOLOR="#00FFFF">

<%
  mousepointer=13
  Set Conn1 = Server.CreateObject("ADODB.Connection")
  conn1.open "DSN=intels"
  Set rcst1 = conn1.execute("select * from pages_catalogue")
  sch_str=request.form("text1")
  doubbytes=len(sch_str)\2
  sch_str=left(sch_str,doubbytes)

' 匹配字串的長度.預處理Request取得的數(shù)據(jù)(用戶輸入的有用信息), 通過計算有效信息長度來截取所需的字串.我們也可以在輸入字串后附加一標志字符(如#chr(7))來處理.
  Response.Write "<CENTER>檢索結(jié)果<HR><Br>"
  Dim result
  result =false
  Response.Write "<UL>"
  do while not rcst1.eof
  tit=rcst1.fields("file_title")
  fn=rcst1.fields("file_name")
  file_name= Server.MapPath ("/") & "\song\chunfeng\" & fn
  to_find=text_match(file_name,sch_str)

' 逐個打開記錄集中當前記錄所指向的文件。用查找的字串對文件的全文本進行匹配比較.
  if to_find then
  url="chunfeng/" & fn
  Response.Write "<A HREF=" & url & ">
" & tit
  end if
  rcst1.movenext
  result=result or to_find
  loop
  Response.Write "</UL>"

' 符合條件的文件標題以超級鏈接形式輸出到客戶端.
  if not result then
  Response.Write "對不起,沒有找到!"
  end if
  mousepointer=0
  %>
  <script RUNAT="Server" LANGUAGE="VBScript">
  function text_match(filename,search_string)
  dim retstring
  dim find_pos
  Dim fso, a
  dim done
  text_match=false
  Set fso = Server .CreateObject("Scripting.FileSystemObject
")

' 創(chuàng)建腳本的文件系統(tǒng),打開文本流以讀入.
  Set a = fso.OpenTextFile(filename, 1, FALSE)

done=a.AtEndOfStream or text_match
  Do While not done
  retstring = a.ReadLine
  find_pos=instr(retstring,search_string)
  if find_pos>0 then text_match=true
  done=a.AtEndOfStream or text_match
  Loop
  a.Close
  end function
  </script>
  </body></html>

[1]

上一篇:如何用POP3接收電子郵件?

欄    目:編程問答

下一篇:如何實現(xiàn)網(wǎng)上考試?

本文標題:如何實現(xiàn)全文檢索?

本文地址:http://mengdiqiu.com.cn/a1/bianchengwenda/12103.html

網(wǎng)頁制作CMS教程網(wǎng)絡編程軟件編程腳本語言數(shù)據(jù)庫服務器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導致的法律后果,本站均不負任何責任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有