校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > 文本搜索

文本搜索

熱門標簽:萊西電子地圖標注 個人可以辦理400電話么 鳳臺百度地圖標注店 怎么在地圖標注自己 縣域地圖標注打印店 外呼系統API接口 金昌電話機器人價格 武夷山旅游地圖標注 修改地圖標注
%
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 bgcolor="#FFFFFF">

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>

標簽:清遠 上海 南京 楚雄 赤峰 涼山 邢臺 通遼

巨人網絡通訊聲明:本文標題《文本搜索》,本文關鍵詞  文本,搜索,文本,搜索,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《文本搜索》相關的同類信息!
  • 本頁收集關于文本搜索的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 宣化县| 谢通门县| 佛冈县| 苏尼特左旗| 嵊州市| 平昌县| 桃园县| 兰西县| 桃园市| 阿拉善右旗| 黄大仙区| 富锦市| 民勤县| 墨脱县| 育儿| 都昌县| 潞城市| 晴隆县| 德令哈市| 清水县| 鸡泽县| 绥芬河市| 安吉县| 永安市| 安西县| 东城区| 大洼县| 霞浦县| 敦化市| 北票市| 清新县| 湖北省| 虹口区| 泾川县| 汾阳市| 定远县| 仙居县| 北海市| 阿坝| 金华市| 曲周县|