濮阳杆衣贸易有限公司

主頁 > 知識庫 > 文本搜索

文本搜索

熱門標(biāo)簽:萊西電子地圖標(biāo)注 個人可以辦理400電話么 鳳臺百度地圖標(biāo)注店 怎么在地圖標(biāo)注自己 縣域地圖標(biāo)注打印店 外呼系統(tǒng)API接口 金昌電話機(jī)器人價格 武夷山旅游地圖標(biāo)注 修改地圖標(biāo)注
%
Head = "搜索"
SearchString = Request("SearchString")
count=0

'把當(dāng)前目錄的實際路徑轉(zhuǎn)換為虛擬路徑
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標(biāo)記中間的字符
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'顯示擴(kuò)展名字為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 bgcolor="#FFFFFF">

h1>%=Head%>/h1>

hr>

form action="search.asp" method="Get">
p>請輸入欲搜索的內(nèi)容: 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("/") ) '設(shè)置開始搜索的路徑!

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

標(biāo)簽:清遠(yuǎn) 上海 南京 楚雄 赤峰 涼山 邢臺 通遼

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《文本搜索》,本文關(guān)鍵詞  文本,搜索,文本,搜索,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《文本搜索》相關(guān)的同類信息!
  • 本頁收集關(guān)于文本搜索的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    天门市| 新蔡县| 娄烦县| 晋江市| 平湖市| 偃师市| 海丰县| 漳平市| 双江| 鲁甸县| 双城市| 云南省| 双桥区| 阜南县| 澄迈县| 朝阳区| 开原市| 牙克石市| 长汀县| 华容县| 昭通市| 马尔康县| 浦北县| 洛扎县| 合川市| 兖州市| 白城市| 介休市| 城步| 广丰县| 隆化县| 镇远县| 启东市| 嵩明县| 临清市| 静安区| 镇巴县| 广饶县| 茂名市| 中山市| 三穗县|