您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
用ASP做一个TOP COOL的站内搜索
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:19:43
am = 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>

上一页  [1] [2] 


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |