婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > 如何做一個文本搜索?

如何做一個文本搜索?

熱門標簽:400電話是怎么申請 重慶400電話哪里辦理 教育機構地圖標注 自適應地圖標注 武漢如何辦理400電話 遼寧營銷智能外呼系統價格多少 語音電銷機器人視頻 推銷電話機器人怎么打電話的 常州智能外呼電銷機器人如何

%
head = "
搜索"
SearchString = Request("SearchString")
count=0

Function UnMapPath( Path )
    UnMapPath = Replace(Mid(Path, Len(Server.MapPath("/")) + 1), "\", "/")

' 把當前目錄的實際路徑轉換為虛擬路徑.
End Function


Function SearchFile( f, s, title )
  Set fo = fs.OpenTextFile(f)
  content = fo.ReadAll

' 把全部文本讀到content.
  fo.Close
  SearchFile = InStr(1, content, S, vbTextCompare) > 0

' 從第一個字符開始檢查content里面是否有S.
  If SearchFile Then

' 如果有,則提出文件title存入變量.
      pos1 = InStr(1, content, "title>", vbTextCompare)
      pos2 = InStr(1, content, "/title>", vbTextCompare)
      title = ""
      If pos1 > 0 And pos2 > 0 Then

' title標記中間的字符.
        title = Mid( content, pos1 + 7, pos2 - pos1 - 7 )
      End If
  End If
End Function

Function FileLink( f, title )
  vPath = UnMapPath( f.Path )

' 獲取路徑.
  If title = "" Then title = f.Name

' 做個鏈接.
  FileLink = "A HREF="""   vPath """>" title "/A>"
  FileLink = "UL>
·" FileLink "/UL>"
End Function

Sub SearchFolder( fd, s )
  found = False 
  For each f In fd.Files
      pos = InStrRev(f.Path, "." )
      If pos > 0 Then
        ext = Mid(f.Path, pos + 1 )
      Else
        ext = ""
      End If
      If LCase(ext) = "htm" Then

' 顯示擴展名字為HTM的文件.
        If SearchFile( f, s, title ) Then
            Response.Write FileLink(f, title)
            count=count+1
            Response.Write cstr(count)
        End If
      End If
  Next

  For each sfd In fd.SubFolders
      SearchFolder sfd, s
  Next
End Sub
%>
html>

head>
meta http-equiv="Content-Type"
content="text/html; charset=gb_2312-80">
meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
title>%=head%>/title>
/head>

body>

h1>
星河影動之無敵文本搜索%=head%>/h1>

hr>

form action="search.asp" method="Get">
    p>
請輸入想要搜索的內容: input type="text"
    size="20" name="SearchString" value="%=SearchString%>"> input
    type="submit" value="
搜索"> /p>
/form>
%
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set fd = fs.GetFolder( Server.MapPath("/") ) 

' 設置開始搜索的路徑.

If SearchString > "" Then
  Response.Write "H2>
搜索font color=red>" SearchString "/font>結果如下:/H2>P>"
  SearchFolder fd,SearchString
End If
%>
hr>
/body>/html>

[1]

標簽:襄陽 朔州 遵義 雞西 柳州 威海 中山 邯鄲

巨人網絡通訊聲明:本文標題《如何做一個文本搜索?》,本文關鍵詞  如何,做,一個,文本,搜索,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《如何做一個文本搜索?》相關的同類信息!
  • 本頁收集關于如何做一個文本搜索?的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 得荣县| 楚雄市| 开鲁县| 东山县| 绵竹市| 三门峡市| 河东区| 莱西市| 新乡市| 泰顺县| 河北省| 荔波县| 古浪县| 汝州市| 夏河县| 拜城县| 保靖县| 巴彦淖尔市| 上犹县| 西盟| 富锦市| 宜阳县| 安宁市| 河源市| 玉门市| 江都市| 莱州市| 龙里县| 鄂托克旗| 高阳县| 巢湖市| 延津县| 从江县| 修文县| 抚远县| 陆丰市| 隆回县| 广河县| 韶关市| 宣武区| 河源市|