无为清净楼资源网 Design By www.qnjia.com
该搜索引擎由一个HTM文件一个ASP文件组成,主要是运用FILESYSTEMOBJECT组件来达到目的,功能强大,修改界面以后可以直接拿来使用,当然加上一点自己的东西就更加好了。
searchpage.htm
该HTM文件用来传入条件
<HTML>
<HEAD>
<TITLE>ASP搜索引擎范例</TITLE>
</HEAD>
<BODY>
<CENTER>
<FORM METHOD=POST ACTION="search.asp">
<TABLE BGCOLOR="#CC6633" BORDER="0">
<TR>
<TD ROWSPAN="3" BGCOLOR="#CC6633" width="21" nowrap> </TD>
<TD width="363" nowrap> <FONT COLOR="#FFFFFF">
<INPUT TYPE="text" NAME="SearchText" SIZE="22">
<INPUT TYPE="checkbox" NAME="Case">
高度敏感</FONT> </TD>
<TD ROWSPAN="3" width="10">
<INPUT TYPE="submit" VALUE="确定">
<P>
<INPUT TYPE="reset" VALUE="清除">
</TD>
<TD ROWSPAN="3" BGCOLOR="#CC6633" width="28"> </TD>
</TR>
<TR>
<TD width="363" nowrap> <FONT COLOR="#FFFFFF"> 返回结果
<SELECT name="rLength" >
<option value="200" selected>长信息 </option>
<option value="100">短信息</option>
<option value="0">只返回连接</option>
</SELECT>
<SELECT NAME="rResults">
<OPTION VALUE="10" SELECTED>10
<OPTION VALUE="25">25
<OPTION VALUE="50">50
</SELECT>
</FONT>
</TD>
</TR>
<TR>
<TD width="363" nowrap> <FONT COLOR="#FFFFFF"> 必须包括:
<INPUT TYPE="checkbox" NAME="iImage">
图片
<INPUT TYPE="checkbox" NAME="iZips">
Zip格式
<INPUT TYPE="checkbox" NAME="iJavaS"> JavaScript
</FONT>
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
<DL>
<DD> </DD>
</DL>
</BODY>
</HTML>
------------------------------------------------------------------------
显示结果的ASP程序
search.asp
<HTML>
<HEAD>
<TITLE>'<%=Request("SearchText")%>'的搜索结果</TITLE>
</HEAD>
<BODY>
<B>'<%=Request("SearchText")%>'的搜索结果</B><BR>
<%
Const fsoForReading = 1
Dim objFile, objFolder, objSubFolder, objTextStream
Dim bolCase, bolFileFound, bolTagFound
Dim strCount, strDeTag, strExt, strFile, strContent, strRoot, strTag, strText, strTitle, strTitleL
Dim reqImage, reqJavaS, reqLength, reqNumber, reqZip
strFile = ".asp .htm .html .js .txt .css"
strRoot = "/"
strText = Request("SearchText")
strTag = Chr(37) & Chr(62)
bolFileFound = False
bolTagFound = False
If Request("Case") = "on" Then bolCase = 0 Else bolCase = 1
If Request("iImage") = "on" Then reqImage = "<IMG" Else reqImage = ""
If Request("iZips") = "on" Then reqZips = ".zip" Else reqImage = ""
If Request("iJavaS") = "on" Then reqJavaS = "JavaScript" Else reqImage = ""
If Request("rResults") = "10" Then reqNumber = 10
If Request("rResults") = "25" Then reqNumber = 25
If Request("rResults") = "50" Then reqNumber = 50
reqLength = Request("rLength")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(strRoot))
schSubFol(objFolder)
Sub schSubFol(objFolder)
For Each objFile in objFolder.Files
If strCount + 1 > reqNumber or strText = "" Then Exit Sub
If Response.IsClientConnected Then
Set objTextStream = objFSO.OpenTextFile(objFile.Path,fsoForReading)
strContent = objTextStream.ReadAll
If InStr(1, strContent, strTag, bolCase) Then
Else
If Mid(objFile.Name, Len(objFile.Name) - 1, 1) = "." Then strExt = Mid(objFile.Name, Len(objFile.Name) - 1, 2)
If Mid(objFile.Name, Len(objFile.Name) - 2, 1) = "." Then strExt = Mid(objFile.Name, Len(objFile.Name) - 2, 3)
If Mid(objFile.Name, Len(objFile.Name) - 3, 1) = "." Then strExt = Mid(objFile.Name, Len(objFile.Name) - 3, 4)
If Mid(objFile.Name, Len(objFile.Name) - 4, 1) = "." Then strExt = Mid(objFile.Name, Len(objFile.Name) - 4, 5)
If InStr(1, strContent, strText, bolCase) And _
InStr(1, strContent, reqImage, 1) And _
InStr(1, strContent, reqZips, 1) And _
InStr(1, strContent, reqJavaS, 1) And _
Instr(1, strFile, strExt, 1) Then
If InStr(1, strContent, "<TITLE>", 1) Then strTitle = Mid(strContent, InStr(1, strContent, "<TITLE>", 1) + 7, InStr(1, strContent, "</TITLE>", 1)) Else strTitle = "未命名"
strCount = strCount + 1
Response.Write "<DL><DT><B><I>"& strCount &"</I></B> - <A HREF=" & objFile.Path & ">" & strTitle & "</A></A></DT><BR><DD>"
strTitleL = InStr(1, strContent, "</TITLE>", 1) - InStr(1, strContent, "<TITLE>", 1) + 7
strDeTag = ""
bolTagFound = False
Do While InStr(strContent, "<")
bolTagFound = True
strDeTag = strDeTag & " " & Left(strContent, InStr(strContent, "<") - 1)
strContent = MID(strContent, InStr(strContent, ">") + 1)
Loop
strDeTag = strDeTag & strContent
If Not bolTagFound Then strDeTag = strContent
If reqLength = "0" Then Response.Write objFile.Path & "</DD></DL>" Else Response.Write Mid(strDeTag, strTitleL, reqLength) & "...<BR><b><FONT SIZE='2'>URL: " & objFile.Path & " - 上次修改时间: " & objFile.DateLastModified & " - " & FormatNumber(objFile.Size / 1024) & "Kbytes</FONT></b></DD></DL>"
bolFileFound = True
End If
objTextStream.Close
End If
End If
Next
End Sub
For Each objSubFolder in objFolder.SubFolders
schSubFol(objSubFolder)
Next
If Not bolFileFound then Response.Write "没有匹配结果"
If bolFileFound then Response.Write "<B>搜索结束</B>"
Set objTextStream = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
%>
</BODY></HTML>
searchpage.htm
该HTM文件用来传入条件
<HTML>
<HEAD>
<TITLE>ASP搜索引擎范例</TITLE>
</HEAD>
<BODY>
<CENTER>
<FORM METHOD=POST ACTION="search.asp">
<TABLE BGCOLOR="#CC6633" BORDER="0">
<TR>
<TD ROWSPAN="3" BGCOLOR="#CC6633" width="21" nowrap> </TD>
<TD width="363" nowrap> <FONT COLOR="#FFFFFF">
<INPUT TYPE="text" NAME="SearchText" SIZE="22">
<INPUT TYPE="checkbox" NAME="Case">
高度敏感</FONT> </TD>
<TD ROWSPAN="3" width="10">
<INPUT TYPE="submit" VALUE="确定">
<P>
<INPUT TYPE="reset" VALUE="清除">
</TD>
<TD ROWSPAN="3" BGCOLOR="#CC6633" width="28"> </TD>
</TR>
<TR>
<TD width="363" nowrap> <FONT COLOR="#FFFFFF"> 返回结果
<SELECT name="rLength" >
<option value="200" selected>长信息 </option>
<option value="100">短信息</option>
<option value="0">只返回连接</option>
</SELECT>
<SELECT NAME="rResults">
<OPTION VALUE="10" SELECTED>10
<OPTION VALUE="25">25
<OPTION VALUE="50">50
</SELECT>
</FONT>
</TD>
</TR>
<TR>
<TD width="363" nowrap> <FONT COLOR="#FFFFFF"> 必须包括:
<INPUT TYPE="checkbox" NAME="iImage">
图片
<INPUT TYPE="checkbox" NAME="iZips">
Zip格式
<INPUT TYPE="checkbox" NAME="iJavaS"> JavaScript
</FONT>
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
<DL>
<DD> </DD>
</DL>
</BODY>
</HTML>
------------------------------------------------------------------------
显示结果的ASP程序
search.asp
<HTML>
<HEAD>
<TITLE>'<%=Request("SearchText")%>'的搜索结果</TITLE>
</HEAD>
<BODY>
<B>'<%=Request("SearchText")%>'的搜索结果</B><BR>
<%
Const fsoForReading = 1
Dim objFile, objFolder, objSubFolder, objTextStream
Dim bolCase, bolFileFound, bolTagFound
Dim strCount, strDeTag, strExt, strFile, strContent, strRoot, strTag, strText, strTitle, strTitleL
Dim reqImage, reqJavaS, reqLength, reqNumber, reqZip
strFile = ".asp .htm .html .js .txt .css"
strRoot = "/"
strText = Request("SearchText")
strTag = Chr(37) & Chr(62)
bolFileFound = False
bolTagFound = False
If Request("Case") = "on" Then bolCase = 0 Else bolCase = 1
If Request("iImage") = "on" Then reqImage = "<IMG" Else reqImage = ""
If Request("iZips") = "on" Then reqZips = ".zip" Else reqImage = ""
If Request("iJavaS") = "on" Then reqJavaS = "JavaScript" Else reqImage = ""
If Request("rResults") = "10" Then reqNumber = 10
If Request("rResults") = "25" Then reqNumber = 25
If Request("rResults") = "50" Then reqNumber = 50
reqLength = Request("rLength")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(strRoot))
schSubFol(objFolder)
Sub schSubFol(objFolder)
For Each objFile in objFolder.Files
If strCount + 1 > reqNumber or strText = "" Then Exit Sub
If Response.IsClientConnected Then
Set objTextStream = objFSO.OpenTextFile(objFile.Path,fsoForReading)
strContent = objTextStream.ReadAll
If InStr(1, strContent, strTag, bolCase) Then
Else
If Mid(objFile.Name, Len(objFile.Name) - 1, 1) = "." Then strExt = Mid(objFile.Name, Len(objFile.Name) - 1, 2)
If Mid(objFile.Name, Len(objFile.Name) - 2, 1) = "." Then strExt = Mid(objFile.Name, Len(objFile.Name) - 2, 3)
If Mid(objFile.Name, Len(objFile.Name) - 3, 1) = "." Then strExt = Mid(objFile.Name, Len(objFile.Name) - 3, 4)
If Mid(objFile.Name, Len(objFile.Name) - 4, 1) = "." Then strExt = Mid(objFile.Name, Len(objFile.Name) - 4, 5)
If InStr(1, strContent, strText, bolCase) And _
InStr(1, strContent, reqImage, 1) And _
InStr(1, strContent, reqZips, 1) And _
InStr(1, strContent, reqJavaS, 1) And _
Instr(1, strFile, strExt, 1) Then
If InStr(1, strContent, "<TITLE>", 1) Then strTitle = Mid(strContent, InStr(1, strContent, "<TITLE>", 1) + 7, InStr(1, strContent, "</TITLE>", 1)) Else strTitle = "未命名"
strCount = strCount + 1
Response.Write "<DL><DT><B><I>"& strCount &"</I></B> - <A HREF=" & objFile.Path & ">" & strTitle & "</A></A></DT><BR><DD>"
strTitleL = InStr(1, strContent, "</TITLE>", 1) - InStr(1, strContent, "<TITLE>", 1) + 7
strDeTag = ""
bolTagFound = False
Do While InStr(strContent, "<")
bolTagFound = True
strDeTag = strDeTag & " " & Left(strContent, InStr(strContent, "<") - 1)
strContent = MID(strContent, InStr(strContent, ">") + 1)
Loop
strDeTag = strDeTag & strContent
If Not bolTagFound Then strDeTag = strContent
If reqLength = "0" Then Response.Write objFile.Path & "</DD></DL>" Else Response.Write Mid(strDeTag, strTitleL, reqLength) & "...<BR><b><FONT SIZE='2'>URL: " & objFile.Path & " - 上次修改时间: " & objFile.DateLastModified & " - " & FormatNumber(objFile.Size / 1024) & "Kbytes</FONT></b></DD></DL>"
bolFileFound = True
End If
objTextStream.Close
End If
End If
Next
End Sub
For Each objSubFolder in objFolder.SubFolders
schSubFol(objSubFolder)
Next
If Not bolFileFound then Response.Write "没有匹配结果"
If bolFileFound then Response.Write "<B>搜索结束</B>"
Set objTextStream = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
%>
</BODY></HTML>
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年11月16日
2024年11月16日
- 模拟之声慢刻CD《柏林之声4》[正版CD低速原抓WAV+CUE]
- 李宗盛 《李宗盛经典金曲》[WAV+CUE][1G]
- 周华健《粤语精选》[WAV+CUE][1G]
- 蔡婧2024《天空》HQCDII头版限量编号[WAV+CUE][1G]
- 陈奂仁.2011-谁是陈奂仁【BBS】【FLAC分轨】
- 群星.2024-幻乐森林影视原声带【韶愔音乐】【FLAC分轨】
- 黎明.1999-向往金色的黎明新歌+精选2CD【环球】【WAV+CUE】
- 发烧女声Méav《美芙的祈祷》发烧女声 [WAV+CUE][820M]
- 雷婷 《我的爱回不来》紫银合金AQCD [WAV+CUE][1G]
- 群星 DTS《天籁之音·唱醉了草原》2CD[WAV分轨][1.6G]
- 魔兽世界wlk毁灭术一键输出宏是什么 wlk毁灭术一键输出宏介绍
- 三国志8重制版无法与武将交流怎么办 无法与武将交流解决方法一览
- 三国志8重制版恶名怎么消除 恶名影响与消除方法介绍
- 模拟之声慢刻CD《柏林之声5》2019[原抓WAV+CUE]
- AlexandraSoumm-Parisestunefte(2024)[24Bit-96kHz]FLAC