article:
tag:
just test

ASP > shawl.qiu?ASP?站内文件搜索类?v1.0 上一篇 | 下一篇

shawl.qiu ASP 站内文件搜索类 v1.0


Subject: shawl.qiu ASP 站内文件搜索类 v1.0 功能描述

主要实现功能:
0. 全局功能
0.1 支持自定义文件类型搜索
0.2 支持自定义是否搜索所有子级文件夹
0.3 支持自定义根目录
0.4 支持自定义站点域名链接

1. 支持文件名搜索
1.1 支持搜索中文文件名

2. 支持文件内容搜索:
2.1 支持不同编码的中文内容搜索
2.2 支持自定义显示搜索到的文件 X个字 内容

后续版本待加功能:
1. 实现数组分页
2. 实现缓存搜索
3. 实现删除编辑功能

最终版本待完成功能:
1. 效率效率效率...

已知 Bug:
0. 全局 Bug:

1. 文件内容搜索:
1.1 搜索关键词如果不包含中文, 显示搜索摘要可能出现乱码(该技术目前尚无法解决)
1.2 无法搜索文件名含空格的文件内容

Subject: shawl.qiu ASP 站内文件搜索类 v1.0
Author: shawl.qiu
Version: 1.0
Date: 2006-10-06
Blog: http://blog.csdn.net/btbtd
E-Mail: shawl.qiu@gmail.com

目录:
1. shawl.qiu ASP 站内文件搜索类 v1.0 源代码

2. 预览
2.1 搜索文件名预览 
2.2 搜索文件内容预览

shawl.qiu
2006-10-06
http://blog.csdn.net/btbtd

1. shawl.qiu ASP 站内文件搜索类 v1.0 源代码

    linenum
  1. <%
  2.     dim oFileSearch
  3.     set    oFileSearch= new cFileSearch
  4.         with oFileSearch
  5.         '-----------------------------------------
  6.         ' shawl.qiu ASP 站内文件搜索类 v1.0
  7.         .auHeader ' 头部信息 [非必须]
  8.         '-----------------------------------------
  9.         ' 参数设置
  10.         .pbQueryString=request.queryString("id") ' [必选项]
  11.         .pbAction="?id=sf" ' [必选项]
  12.         .pbWww=" http://127.0.0.1:81" '站点域名 [非必须]
  13.         .pbRoot=server.MapPath("/") ' 站点根目录 [必选项] 
  14.         .pbRootForSearch=server.MapPath("/") ' 默认搜索路径 [必选项]
  15.         '-----------------------------------------
  16.         ' 允许搜索的文件类型设置
  17.         ' 设置允许搜索的文件类型 all 或 空值 搜索全部, 搜索特定文件类型请用竖杠(|)分隔, 不要带点(.).
  18.         '-----------------------
  19.         ' 文件名搜索
  20.         .pbAcceptExtensionFnSrh="asp|htm|html|txt|xml" ' 允许搜索的文件类型 [非必须]
  21.         '------------
  22.         ' 文件内容搜索
  23.         .pbAcceptExtensionCntSrh="asp|htm|html|txt" ' 允许搜索的文件类型, 必须指定文本文件类型 [必选项]
  24.         ' 设置搜索文件出现频率最高的文件编码, 空值为 gb2312. 
  25.         ' 注: 如果搜索关键词中没有中文, 搜索结果就可能出现乱码, 请设置下面项为站点使用最多的编码.
  26.         .pbAcceptExtensionCntSrhEncoding="utf-8" ' [非必须]
  27.         .pbAcceptExtensionCntSrhCntLen=300 ' 截取并显示符合搜索关键词文件的N长度字符 [非必须]
  28.         '-----------------------------------------
  29.         ' 表单域默认设置 
  30.         '-------------------
  31.         .pbFormSelectDfut=1 ' 默认选中搜索文件名或搜索文件内容, 0:搜索文件名 1:搜索文件内容 [非必须]
  32.         .pbFormRadioCkdSstv=0 ' 敏感度默认选中哪个 Radio, 0:标准 1:模糊 2:精度 [非必须]
  33.         .pbFormRadioCkdSbfldr=1 ' 是否搜索子目录默认选中与否, 0:不选 1:选中 [非必须]
  34.         '-----------------------------------------
  35.         .pgOperate ' 执行操作 [必选项]
  36.         '-----------------------------------------
  37.         .pgForm ' 显示表单域 [必选项]
  38.         '-----------------------------------------
  39.         .pgReport ' 显示搜索结果及耗时  [非必须]
  40.         .pgShowFound ' 显示搜索到的文件 [非必须]
  41.         '-----------------------------------------
  42.         .auDesc ' 功能描述 [非必须]
  43.         .auInfo ' 作者及版本信息 [非必须]
  44.         '-----------------------------------------
  45.         end with
  46.     set oFileSearch=nothing    
  47.  
  48.     class cFileSearch
  49.         private sub class_initialize()
  50.             pvTimer=timer()
  51. %>
  52.         <style type="text/css">
  53.         /*<![CDATA[*/
  54.  
  55.             body{margin:0px auto!important; width:768px!important;font: 12px Arial, Helvetica, sans-serif!important;}
  56.             a:link, a:hover, a:visited{text-decoration:none!important;}
  57.             .alCenter{text-align:center!important;}
  58.             .alRight{text-align:right!important;}
  59.             .corBlack{color:black!important;}
  60.             .corRed{color:red!important;}
  61.             .corBlue{color:blue!important;}
  62.             .corGreen{color:green!important;}
  63.             .bgCorGray{background-color:#F3F3F3!important;}
  64.             .bgCorDp{ background-color:#FEF3E9!important; border-bottom:1px dashed blue!important;}
  65.             .bgCorLh{ background-color:#F5FEF9!important; border-bottom:1px dashed black!important;}
  66.             .dspTable{display:table!important;}
  67.             .w100pc{width:100%!important;}
  68.             .pad10px{padding:10px!important;}
  69.             .ftBold{font-weight:bold!important;}
  70.             .ftSize12px{font-size:12px!important;}
  71.             .ftSize28px{font-size:28px!important;}
  72.             .ftWeightNrm{font-weight:normal!important;letter-spacing: 1px!important;}
  73.             .pad0px {padding:0px!important;}
  74.             .pad2_0px {padding:2px 0px!important;}
  75.             .pad2_5px {padding:2px 5px!important;}
  76.             .pad5px {padding:5px!important;}
  77.             .mrg0px {margin:0px!important;}
  78.             .mrg5_0px {margin:5px 0px!important;}
  79.             .mrg2_0_10_0px {margin:2px 0px 10px 0px!important;}
  80.             .mrg10_0px {margin:10px 0px!important;}
  81.             .ftSize14px * {font-size:14px!important;}
  82.             .hrLevel1{border: 0px none #ffffff!important;border-bottom:1px solid red!important; }
  83.             .hrLevel2{border: 0px none #ffffff!important;border-bottom:1px dashed blue!important;  }
  84.             .hrLevel3{border: 0px none #ffffff!important;border-bottom:1px dashed green!important; }
  85.             /* main class */
  86.             .cList{ padding:0px 0px 0px 2px!important; line-height:20px!important; }
  87.             .cFileList{ background-color:#FFFFCC!important;}
  88.             .cType{ margin:5px 0px 5px 0px}
  89.             .cResult{ margin:0px 0px -10px 0px}
  90.             .cFsrh{ background-color:#ECF4FD!important; margin:0px 0px 0px 0px!important; padding:5px!important; color:blue!important; word-wrap:break-word!important; width:100%!important;}
  91.             /* main id */
  92.             #iForChange, #iRadio{display:inline!important;}
  93.         /*]]>*/
  94.         </style>
  95.     <%    
  96.             if isObject(fCkFsoAvailable)=false then
  97.                 response.write "<div class=""alCenter corRed w100pc ftSize28px pad10px"">"
  98.                 response.write "本程序需要 FSO 对象支持, 该服务器不支持 FSO, 操作被取消</div>"
  99.                 response.end
  100.             end if
  101.             
  102.             pvKeyword=request.form("fmKeyword")
  103.             pvNumFilePath=0
  104.             pvNumFolder=0
  105.             pvNumTotalFile=0
  106.             
  107.             pbAcceptExtensionFnSrh="all"
  108.             pbAcceptExtensionCntSrh="txt"
  109.             
  110.             pbAcceptExtensionCntSrhEncoding="gb2312"
  111.             pbAcceptExtensionCntSrhCntLen=200
  112.             
  113.             pbFormSelectDfut=0
  114.             
  115.             subject="shawl.qiu ASP 站内文件搜索类 v1.0"
  116.             auBlogUrl="<a href="" http://blog.csdn.net/btbtd"" target=""_blank""> http://blog.csdn.net/btbtd</a><br/>"
  117.             auEmail="<a href=""mailto:shawl.qiu@gmail.com"">shawl.qiu@gmail.com</a>"
  118.         end sub
  119.         
  120.         private sub class_terminate()
  121.         end sub
  122.         
  123.         public pbAction, pbQueryString
  124.         public pbWww
  125.         public pbRoot, pbRootForSearch
  126.         public pbAcceptExtensionFnSrh, pbAcceptExtensionCntSrh
  127.         public pbAcceptExtensionCntSrhEncoding, pbAcceptExtensionCntSrhCntLen
  128.         public pbFormSelectDfut, pbFormRadioCkdSstv, pbFormRadioCkdSbfldr
  129.         
  130.         private subject, auBlogUrl, auEmail
  131.         private pvKeyword
  132.         private pvNumFilePath, pvNumFolder, pvNumTotalFile
  133.         private pvTimer
  134.         private pvTotalFileArray
  135.         private pvFmQueryOption, pvFmKeyword, pvFmSensitive, pvFmSearchSubFolder
  136.         private pvTypeForSeek
  137.         private pvContentSrhDigestArray
  138.         
  139.         public property get pgOperate
  140.             pgOperate=fOperate
  141.         end property
  142.         
  143.         public property get pgForm
  144.             pgForm=fFormFileSearch
  145.         end property
  146.         
  147.         public property get pgReport
  148.             if pbQueryString="" or pvNumFolder<1 then exit property
  149.             response.write "<div class=""cResult alRight w100pc"">"
  150.             response.write "本次查找共搜索了 <font class=""corBlue"">"&pvNumFolder&" 个</font> 文件夹, "
  151.             response.write "一共有 <font class=""corBlue"">"&pvNumTotalFile&"个</font> 文件, "
  152.             response.write "找到 <font class=""corBlue"">"&pvNumFilePath&"个</font> 文件, "
  153.             response.write "耗时 <font class=""corBlue"">"&pvTimer&" 毫秒</font>."
  154.             response.write "</div>"
  155.         end property
  156.         
  157.         public property get pgShowFound
  158.             if isArray(pvTotalFileArray)=false then exit property
  159.             dim i, iTemp
  160.                 response.write "<ol class=""cFileList pad0px"">"
  161.             for i=0 to uBound(pvTotalFileArray)
  162.                 if i mod 2=0 then iTemp="bgCorDp" else iTemp="bgCorLh"
  163.                     response.write "<li class=""cList mrg0px "&iTemp&""">"
  164.                 call trsfPath(pvTotalFileArray(i), pbRoot)
  165.                     response.write "</li>"
  166.                 if pvFmQueryOption="fmFileContent" then
  167.                     response.write "<xmp class=""cFsrh"">"
  168.                     response.write pvContentSrhDigestArray(i)
  169.                     response.write "</xmp>"
  170.                 end if
  171.             next
  172.                 response.write "</ol>"
  173.         end property
  174.         
  175.         private function pbWww_
  176.             if pbWww<>"" then 
  177.                 pbWww_=fRegExpSgl(pbWww,true,true,false,"\/$","")
  178.             end if
  179.         end function
  180.         
  181.         private function fOperate()
  182.             dim fmQueryOption, fmKeyword, fmSensitive, fmSearchSubFolder, fmTypeForSeek
  183.             
  184.             if isObject(request.form)=false then exit function
  185.             
  186.             dim temp
  187.             for each temp in request.Form
  188.                 execute temp&"=request.form(temp)"
  189.             next
  190.             
  191.             if fmKeyword="" then exit function 
  192.                 pvFmQueryOption=fmQueryOption
  193.                 pvFmKeyword=fmKeyword
  194.                 pvFmSensitive=fmSensitive
  195.                 pvFmSearchSubFolder=fmSearchSubFolder
  196.             
  197.             if pbAcceptExtensionFnSrh<>"all" and pbAcceptExtensionFnSrh<>"" then
  198.                 if fmTypeForSeek=""  then exit function
  199.             end if
  200.             
  201.                 pvTypeForSeek=fmTypeForSeek
  202.         
  203.             select case pvFmQueryOption
  204.                 case "fmFileName"
  205.                     if pvFmSearchSubFolder<>"" then 
  206.                         call fRecursiveFolder(pbRootForSearch, fmKeyword, fmSensitive, fmTypeForSeek, true)
  207.                     else
  208.                         call fRecursiveFolder(pbRootForSearch, fmKeyword, fmSensitive, fmTypeForSeek, false)
  209.                     end if
  210.                 case "fmFileContent"
  211.                     if pvFmSearchSubFolder<>"" then 
  212.                         call fRecursiveFile(pbRootForSearch, fmKeyword, fmTypeForSeek, true)
  213.                     else
  214.                         call fRecursiveFile(pbRootForSearch, fmKeyword, fmTypeForSeek, false)
  215.                     end if
  216.             end select
  217.                 pvTimer=formatNumber((timer-pvTimer)*1000,0)
  218.         end function
  219.  
  220.         private function fRecursiveFile(path, kWord, fltp, Rcsv)
  221.             dim folder, folderTemp
  222.             dim folderFile
  223.             dim fltpTemp
  224.             dim temp
  225.             dim temp1, temp1_, temp1NumStart, temp1NumEnd
  226.             dim ckKeyword, ckKeyword_, ckKeyword__
  227.             dim tepmCnt
  228.                 ckKeyword=false
  229.             for ckKeyword_=1 to len(pvFmKeyword)
  230.                 ckKeyword__=ascW(mid(pvFmKeyword,ckKeyword_,1))
  231.                 if ckKeyword__>127 or ckKeyword__<0 then ckKeyword=true:exit for
  232.             next
  233.             on error resume next
  234.             set folder=createObject("scripting.fileSystemOBject").getFolder(path)
  235.                     pvNumFolder=pvNumFolder+1
  236.                 for each folderFile in folder.files
  237.                     for each temp in split(pvTypeForSeek,",")
  238.                             temp=trim(temp)
  239.                         if strComp(temp, fGetExtensionName(folderFile), 1)=0 then
  240.                             if ckKeyword then
  241.                                 temp1=fReadAllText(folderFile, "gb2312")
  242.                                 temp1_=inStr(1, temp1,pvFmKeyword, 1)
  243.                                 if temp1_=0 then
  244.                                     temp1=fReadAllText(folderFile, "utf-8")
  245.                                     temp1_=inStr(1, temp1,pvFmKeyword, 1)
  246.                                 end if
  247.                             else
  248.                                 temp1=fReadAllText(folderFile, pbAcceptExtensionCntSrhEncoding)
  249.                                 temp1_=inStr(1, temp1,pvFmKeyword, 1)
  250.                             end if
  251.                             if temp1_<>0 then
  252.                                 if temp1_<pbAcceptExtensionCntSrhCntLen/2  then
  253.                                     temp1NumStart=temp1_
  254.                                 else
  255.                                     temp1NumStart=temp1_-pbAcceptExtensionCntSrhCntLen/2 
  256.                                 end if 
  257.                                 
  258.                                 if lenB(temp1)-temp1_<pbAcceptExtensionCntSrhCntLen/2 then 
  259.                                     temp1NumEnd=(lenB(temp1)-temp1_)+pbAcceptExtensionCntSrhCntLen/2 
  260.                                 else 
  261.                                     temp1NumEnd=pbAcceptExtensionCntSrhCntLen
  262.                                 end if
  263.                                 
  264.                                 tepmCnt=mid(temp1, temp1NumStart,temp1NumEnd)
  265.                                 tepmCnt=replace(tepmCnt,"<","<")
  266.                                 tepmCnt=replace(tepmCnt,">",">")
  267.                                 
  268.                                 if isArray(pvTotalFileArray) then redim preserve pvTotalFileArray(pvNumFilePath) _
  269.                                 else redim pvTotalFileArray(pvNumFilePath)
  270.                                     pvTotalFileArray(pvNumFilePath)=folderFile
  271.                                     
  272.                                 if isArray(pvContentSrhDigestArray) then redim preserve pvContentSrhDigestArray(pvNumFilePath) _
  273.                                 else redim pvContentSrhDigestArray(pvNumFilePath)
  274.                                     pvContentSrhDigestArray(pvNumFilePath)=tepmCnt
  275.                                     pvNumFilePath=pvNumFilePath+1
  276.                             end if
  277.                         end if
  278.                     next
  279.                         pvNumTotalFile=pvNumTotalFile+1
  280.                 next
  281.                 if Rcsv then 
  282.                     for each folderTemp in folder.subfolders
  283.                         call fRecursiveFile(folderTemp, kWord, pvTypeForSeek, true)
  284.                     next
  285.                 end if
  286.             set folder=nothing
  287.         end function
  288.         
  289.         private function fReadAllText(fnph_, cstm)
  290.         '-----------------------------------------------------
  291.         ' 读取文本文件, 自动发现编码 或 自定编码函数 By shawl.qiu
  292.         ' sample call: response.write  fReadAllText(server.MapPath("a0.asp"),"utf-8") ' unicode
  293.         ' sample call: response.write  fReadAllText(server.MapPath("a0.asp"),"") ' auto discover
  294.         '-----------------------------------------------------
  295.             dim obj_, temp, cSet, pNum
  296.             set    obj_=createObject("adodb.stream")
  297.                 with obj_
  298.                     .mode=3
  299.                     if cstm="" then .type=1
  300.                         .open
  301.                         .loadFromFile fnph_
  302.                     if cstm="" then
  303.                             temp=hex(ascB(.read(1)))
  304.                             temp=temp & hex(ascB(.read(1)))
  305.                         select case temp
  306.                             case "EFBB"
  307.                                 cSet="utf-8"
  308.                                 pNum=2
  309.                             case "FFFE"
  310.                                 cSet="unicode"
  311.                                 pNum=2
  312.                             case else
  313.                                 cSet="gb2312"
  314.                                 pNum=0
  315.                         end select
  316.                         .position=0
  317.                     else
  318.                         cSet=cstm
  319.                         pNum=0
  320.                     end if
  321.                     .type=2
  322.                     .charset=cSet
  323.                     .position=pNum
  324.                     fReadAllText=.readText
  325.                     .close 
  326.                 end with 'shawl.qiu code'
  327.             set obj_=nothing
  328.         end function
  329.  
  330.         private function fRecursiveFolder(path, kWord, cndt, fltp, Rcsv)
  331.             dim folder, folderTemp
  332.             dim folderFile
  333.             dim fltpTemp
  334.             
  335.             set folder=createObject("scripting.fileSystemOBject").getFolder(path)
  336.                     pvNumFolder=pvNumFolder+1
  337.                 for each folderFile in folder.files
  338.                     select case cndt
  339.                         case "insensitive"
  340.                             if inStr(1, fGetBaseName(folderFile.name), kWord,1)<>0 then
  341.                                 call fRecursiveFolderTemp(fltp, folderFile)
  342.                             end if
  343.                         case "precise"
  344.                             if strComp(fGetBaseName(folderFile.name), kWord,1 )=0 then
  345.                                 call fRecursiveFolderTemp(fltp, folderFile)
  346.                             end if
  347.                         case else
  348.                             if strComp(left(fGetBaseName(folderFile.name),len(kWord)),kWord,1)=0 then
  349.                                 call fRecursiveFolderTemp(fltp, folderFile)
  350.                             end if
  351.                     end select
  352.                     pvNumTotalFile=pvNumTotalFile+1
  353.                 next
  354.                 if Rcsv then 
  355.                     for each folderTemp in folder.subfolders
  356.                         call fRecursiveFolder(folderTemp, kWord, cndt, pvTypeForSeek, true)
  357.                     next
  358.                 end if
  359.             set folder=nothing
  360.         end function
  361.         
  362.         private function fRecursiveFolderTemp(fltp_, flph_)
  363.             dim temp_
  364.             if fltp_="all"  then
  365.                 if isArray(pvTotalFileArray) then redim preserve pvTotalFileArray(pvNumFilePath) _
  366.                 else redim pvTotalFileArray(pvNumFilePath)
  367.                     pvTotalFileArray(pvNumFilePath)=flph_
  368.                     pvNumFilePath=pvNumFilePath+1
  369.             else
  370.                 for each temp_ in split(fltp_,",")
  371.                         temp_=trim(temp_)
  372.                     if strComp(fGetExtensionName(flph_),temp_,1)=0 then
  373.                         if isArray(pvTotalFileArray) then redim preserve pvTotalFileArray(pvNumFilePath) _
  374.                         else redim pvTotalFileArray(pvNumFilePath)
  375.                             pvTotalFileArray(pvNumFilePath)=flph_
  376.                             pvNumFilePath=pvNumFilePath+1
  377.                     end if
  378.                 next
  379.             end if
  380.         end function
  381.         
  382.         private function fGetExtensionName(path)
  383.         ' fso 取得文件扩展名函数  By shawl.qiu
  384.             fGetExtensionName=createObject("scripting.fileSystemObject").getExtensionName(path)
  385.         end function
  386.         
  387.         private function fGetBaseName(path)
  388.         ' fso 取得文件名函数(不带扩展名)  By shawl.qiu
  389.             fGetBaseName=createObject("scripting.fileSystemObject").getBaseName(path)
  390.         end function
  391.         
  392.         private function fCkFsoAvailable()
  393.         ' 检测服务器是否支持 FSO 函数  By shawl.qiu
  394.             on error resume next
  395.             dim fso_
  396.             set fso_=createObject("scripting.fileSystemObject")
  397.                 if isObject(fso_) then
  398.                     set fCkFsoAvailable=fso_
  399.                     set fCkFsoAvailable=nothing
  400.                 end if
  401.             set fso_=nothing
  402.         end function
  403.         
  404.         private function trsfPath(sPath, rPath)
  405.             dim temp
  406.                 temp=mid(sPath,len(rPath)+1)
  407.             if inStr(temp,"\")<>0 then
  408.                 temp=pbWww_&replace(temp,"\","/")
  409.             end if
  410.                 response.write "<a href="""
  411.                 response.write temp
  412.                 response.write """ target=""_blank"">"
  413.                 response.write temp
  414.                 response.write "</a>"
  415.         end function
  416.         
  417.         function fRegExpSgl(str,glb,igc,mtl,pt,rpt)
  418.             dim re_
  419.             set re_=new RegExp
  420.                 with re_
  421.                     .global=glb
  422.                     .ignoreCase=igc
  423.                     .multiline=mtl
  424.                     .pattern=pt
  425.                     fRegExpSgl=.replace(str,rpt)
  426.                 end with
  427.             set re_=nothing
  428.         end function 'shawl.qiu code'
  429.     
  430.         private function fFormFileSearch() 
  431.             if not isNumeric(pbFormRadioCkdSstv) or RadioCkeckedTemp<0 or RadioCkeckedTemp>2 then _
  432.             pbFormRadioCkdSstv=0
  433.             
  434.                 'response.write pvKeyword
  435.             if not isNumeric(pbFormRadioCkdSbfldr) or pbFormRadioCkdSbfldr<0 or _
  436.             pbFormRadioCkdSbfldr>1 then pbFormRadioCkdSbfldr=1
  437.     
  438.             dim RadioCkeckedTemp:RadioCkeckedTemp=" checked=""checked"" "
  439.             dim sleSelected:sleSelected=" selected=""selected"" "
  440.             dim iptDisabled:iptDisabled=" disabled=""disabled"" "
  441. %>
  442. <form action="<% response.write pbAction %>" method="post" name="formFileSearch" id="formFileSearch" class="mrg0px pad0px">
  443. <select name="fmQueryOption" onchange="fDynHtml(this.value,'iForChange');">
  444.   <option value="fmFileName" <% 
  445.    if pbQueryString="" then
  446.            if pbFormSelectDfut=0 then response.write sleSelected 
  447.    else
  448.           if request.form("fmQueryOption")="fmFileName" then response.write sleSelected 
  449.    end if%> >文件名搜索</option>
  450.   <option value="fmFileContent" <% 
  451.   if pbQueryString="" then 
  452.           if pbFormSelectDfut=1 then response.write sleSelected 
  453.   else    
  454.           if request.form("fmQueryOption")="fmFileContent" then response.write sleSelected 
  455.   end if%> >文件内容搜索</option>
  456. </select>  
  457. <input name="fmKeyword" type="text" size="30" maxlength="255" value="<%
  458. if pvKeyword<>"" then response.write pvKeyword %>" onmousemove="select();focus();" />
  459. <input type="submit" value="Submit" /><br/>
  460. <div class="" id="iRadio">敏感觉: 
  461. <input name="fmSensitive" type="radio" value="standard" <%
  462.     if pbQueryString="" then 
  463.         if pbFormRadioCkdSstv=0 then response.write  RadioCkeckedTemp
  464.         if pbFormSelectDfut=1 then response.write iptDisabled
  465.     else 
  466.         if request.form("fmSensitive")="standard" then response.write RadioCkeckedTemp
  467.     end if    
  468.     if request.form("fmQueryOption")="fmFileContent" then response.write iptDisabled %> />:标准
  469. <input name="fmSensitive" type="radio" value="insensitive"<%
  470.     if pbQueryString="" then 
  471.         if pbFormRadioCkdSstv=1 then response.write  RadioCkeckedTemp
  472.         if pbFormSelectDfut=1 then response.write iptDisabled
  473.     else 
  474.         if request.form("fmSensitive")="insensitive" then response.write RadioCkeckedTemp
  475.     end if    
  476.     if request.form("fmQueryOption")="fmFileContent" then response.write iptDisabled %> />:模糊
  477. <input name="fmSensitive" type="radio" value="precise" <%
  478.     if pbQueryString="" then 
  479.         if pbFormRadioCkdSstv=2 then response.write  RadioCkeckedTemp
  480.         if pbFormSelectDfut=1 then response.write iptDisabled
  481.     else 
  482.         if request.form("fmSensitive")="precise" then response.write RadioCkeckedTemp
  483.     end if    
  484.     if request.form("fmQueryOption")="fmFileContent" then response.write iptDisabled %> /> :精确  
  485. </div>
  486. <input name="fmSearchSubFolder" type="checkbox" id="fmSearchSubFolder" value="yes"<%
  487.     if pbQueryString="" then 
  488.         if pbFormRadioCkdSbfldr=1 then response.write RadioCkeckedTemp
  489.     else 
  490.         if request.form("fmSearchSubFolder")<>"" then response.write RadioCkeckedTemp
  491.     end if    %> />:搜索子目录
  492. <div class="cType alCenter">允许查找的文件类型:
  493.     <div id="iForChange">
  494. <%
  495.     dim temp1
  496.     select case request.form("fmQueryOption")
  497.         case "fmFileName"
  498.             temp1=pbAcceptExtensionFnSrh
  499.         case "fmFileContent"
  500.             temp1=pbAcceptExtensionCntSrh
  501.         case ""
  502.             if pbFormSelectDfut=0 then temp1=pbAcceptExtensionFnSrh else temp1=pbAcceptExtensionCntSrh
  503.     end select
  504.     response.write fFormTemp_(temp1, "fmTypeForSeek", RadioCkeckedTemp)
  505. %> 
  506.     </div>
  507.     <input type="button" value="全选" onclick="fSelect('all','fmTypeForSeek')"/> 
  508.     <input type="button" value="反选" onclick="fSelect('reverse','fmTypeForSeek')"/> 
  509.     <input type="button" value="全不选" onclick="fSelect('reset','fmTypeForSeek')"/>
  510. </div>
  511. </form>
  512. <script type="text/javascript">
  513. //<![CDATA[ 
  514.     //Subject: Javascript 复选框 全选, 反选, 全不选 函数 By shawl.qiu
  515.     function fSelect(str,iptName){
  516.         var gItem=document.getElementsByTagName('input')
  517.         for(i=0;i<gItem.length;i++){
  518.             if(gItem[i].name==iptName){
  519.                 if (str=='all'){ gItem[i].checked=true;} //全选
  520.                 //---------------------------------------------- start 反选
  521.                 else if (str=='reverse'){ 
  522.                     if(gItem[i].checked==false){gItem[i].checked=true;} //如果没有选中, 则设为选中
  523.                     else{gItem[i].checked=false;} }//如果选中, 则设为没有选中  
  524.                 //---------------------------------------------- end 反选
  525.                 else if (str=='reset'){ gItem[i].checked=false;} //全不选
  526.             }
  527.         }
  528.     }
  529.     
  530.     //Subject: Javascript 函数: 动态改变 HTML 标签中的内容
  531.     function fDynHtml(iptVal, id_){
  532.         if (iptVal=='fmFileName'){
  533.             document.getElementById(id_).innerHTML="<% response.write  _
  534.             fFormTemp(pbAcceptExtensionFnSrh, "fmTypeForSeek", "fmFileName", RadioCkeckedTemp, "fmQueryOption") %>"; 
  535.             var gItem=document.getElementById('iRadio').getElementsByTagName('input')
  536.             for(i=0;i<gItem.length;i++){
  537.                 gItem[i].disabled=false;
  538.                 gItem[0].checked=true;
  539.             }
  540.         }
  541.         else if(iptVal=='fmFileContent'){
  542.             document.getElementById(id_).innerHTML="<% response.write  _
  543.             fFormTemp(pbAcceptExtensionCntSrh, "fmTypeForSeek", "fmFileContent", RadioCkeckedTemp, "fmQueryOption") %>"; 
  544.             var gItem=document.getElementById('iRadio').getElementsByTagName('input')
  545.             for(i=0;i<gItem.length;i++){
  546.                 gItem[i].disabled=true;
  547.             }
  548.         }
  549.     }
  550. //]]> shawl.qiu script
  551. </script>
  552. <%    end function
  553.         
  554.         private function fFormTemp_(fltp_, iptName, ckStr)
  555.             dim temp, temp_
  556.             if fltp_="all" then fFormTemp="全部类型":exit function
  557.             for each temp in split(fltp_,"|")
  558.                     fFormTemp_=fFormTemp_&"<input name="""&iptName&""" type=""checkbox"" value="""
  559.                     fFormTemp_=fFormTemp_&temp&""""
  560.                 if pbQueryString="" then 
  561.                     fFormTemp_=fFormTemp_&ckStr
  562.                 else
  563.                     for each temp_ in split(request.form(iptName),",")
  564.                         if strComp(trim(temp), trim(temp_),1)=0 then
  565.                             fFormTemp_=fFormTemp_&ckStr
  566.                         end if
  567.                     next
  568.                 end if
  569.                     fFormTemp_=fFormTemp_&"/>:"&temp
  570.             next
  571.         end function
  572.  
  573.         private function fFormTemp(fltp_, iptName, iptVal, ckStr, sle4ck)
  574.             dim temp, temp_
  575.                 ckStr=replace(ckStr,"""","'")
  576.                 if fltp_="all" then fFormTemp="全部类型":exit function
  577.             for each temp in split(fltp_,"|")
  578.                 fFormTemp=fFormTemp&"<input name='"&iptName&"' type='checkbox' value='"
  579.                 fFormTemp=fFormTemp&temp&"'"
  580.                 if pbQueryString="" then 
  581.                     fFormTemp=fFormTemp&ckStr
  582.                 else
  583.                     if iptVal= request.form(sle4ck) then
  584.                         for each temp_ in split(request.form(iptName),",")
  585.                             if strComp(trim(temp), trim(temp_),1)=0 then
  586.                                 fFormTemp=fFormTemp&ckStr
  587.                             end if
  588.                         next
  589.                     else
  590.                         fFormTemp=fFormTemp&ckStr
  591.                     end if
  592.                 end if
  593.                 fFormTemp=fFormTemp&"/>:"&temp
  594.             next
  595.         end function
  596.                         
  597.         public property get auHeader
  598.             response.write "<div class=""dspTable w100pc pad10px corRed alCenter ftSize28px"">"
  599.             response.write subject
  600.             response.write "</div>"
  601.         end property
  602.  
  603.         public property get auDesc %>
  604.     <div class="ftSize14px pad2px_0px">
  605.         <font class="ftBold">Subject:</font> <font class="corRed"><% response.write subject %> 功能描述</font><br/>
  606.         <p/>
  607.         <font class="ftBold">主要实现功能:</font><br/>
  608.         <font class="corRed">0. 全局功能 </font><br/>
  609.         <font class="corBlue">
  610.         0.1 支持自定义文件类型搜索 <br/>
  611.         0.2 支持自定义是否搜索所有子级文件夹 <br/>
  612.         0.3 支持自定义根目录 <br/>
  613.         0.4 支持自定义站点域名链接 <br/>
  614.         </font>
  615.         <p/>
  616.         <font class="corRed">1. 支持文件名搜索 </font> <br/>
  617.         <font class="corBlue">
  618.         1.1 支持搜索中文文件名 <br/>
  619.         </font>
  620.         <p/>
  621.         <font class="corRed">2. 支持文件内容搜索: </font> <br/>
  622.         <font class="corBlue">
  623.         2.1 支持不同编码的中文内容搜索<br/>
  624.         2.2 支持自定义显示搜索到的文件 X个字 内容<br/>
  625.         </font>
  626.         <p/>
  627.         <font class="ftBold">后续版本待加功能:</font> <br/>
  628.         <font class="corRed">
  629.         1. 实现数组分页 <br/>
  630.         2. 实现缓存搜索 <br/>
  631.         3. 实现删除编辑功能 <br/>
  632.         </font>
  633.         <p/>
  634.         <font class="ftBold">最终版本待完成功能:</font> <br/>
  635.         <font class="corRed">
  636.         1. 效率效率效率...
  637.         </font>
  638.         <p/>
  639.         <font class="ftBold">已知 Bug:</font><br/>
  640.         <font class="corRed">0. 全局 Bug: </font><br/>
  641.         <p/>
  642.         <font class="corRed">1. 文件内容搜索: </font><br/>
  643.         <font class="corBlue">
  644.         1.1 搜索关键词如果不包含中文, 显示搜索摘要可能出现乱码(该技术目前尚无法解决)<br/>
  645.         1.2 无法搜索文件名含空格的文件内容<br/>
  646.         </font>
  647.     </div>
  648. <%        end property
  649.         
  650.         public property get auInfo
  651.             response.write "<div class=""ftSize14px pad2px_0px"">"
  652.             response.write "Subject: <font class=""corRed"">"&subject&"</font><br/>"
  653.             response.write "Author: shawl.qiu<br/>"
  654.             response.write "Version: 1.0<br/>"
  655.             response.write "Date: 2006-10-06<br/>"
  656.             response.write "Blog: "&auBlogUrl
  657.             response.write "E-Mail: "&auEmail
  658.             response.write "</div>"
  659.         end property
  660.     end class
  661. %>
  662. <p/>
  663. <a href="?">back</a>
  664. <p/>

2. 预览

2.1 搜索文件名预览 
shawl.qiu ASP 站内文件搜索类 v1.0

敏感觉: :标准 :模糊 :精确
:搜索子目录
允许查找的文件类型:
:asp:htm:html:txt:xml
本次查找共搜索了 246 个 文件夹, 一共有 1106个 文件, 找到 13个 文件, 耗时 859 毫秒.
  1. http://127.0.0.1:81/a0.asp
  2. http://127.0.0.1:81/a0_1.asp
  3. http://127.0.0.1:81/a0_2.asp
  4. http://127.0.0.1:81/a0_3.asp
  5. http://127.0.0.1:81/a0_4.asp
  6. http://127.0.0.1:81/a0_5.asp
  7. http://127.0.0.1:81/a0_6.asp
  8. http://127.0.0.1:81/a0_7.asp
  9. http://127.0.0.1:81/temp/2006-09-17/a0.asp
  10. http://127.0.0.1:81/temp/2006-09-22/a0.asp
  11. http://127.0.0.1:81/temp/2006-09-30/a0.asp
  12. http://127.0.0.1:81/temp/2006-8-17/a0.asp
  13. http://127.0.0.1:81/temp/2006-8-6/a0.asp
Subject: shawl.qiu ASP 站内文件搜索类 v1.0 功能描述

主要实现功能:
0. 全局功能
0.1 支持自定义文件类型搜索
0.2 支持自定义是否搜索所有子级文件夹
0.3 支持自定义根目录
0.4 支持自定义站点域名链接

1. 支持文件名搜索
1.1 支持搜索中文文件名

2. 支持文件内容搜索:
2.1 支持不同编码的中文内容搜索
2.2 支持自定义显示搜索到的文件 X个字 内容

后续版本待加功能:
1. 实现数组分页
2. 实现缓存搜索
3. 实现删除编辑功能

最终版本待完成功能:
1. 效率效率效率...

已知 Bug:
0. 全局 Bug:

1. 文件内容搜索:
1.1 搜索关键词如果不包含中文, 显示搜索摘要可能出现乱码(该技术目前尚无法解决)
1.2 无法搜索文件名含空格的文件内容

Subject: shawl.qiu ASP 站内文件搜索类 v1.0
Author: shawl.qiu
Version: 1.0
Date: 2006-10-06
Blog: http://blog.csdn.net/btbtd
E-Mail: shawl.qiu@gmail.com

back

2.2 搜索文件内容预览
shawl.qiu ASP 站内文件搜索类 v1.0

敏感觉: :标准 :模糊 :精确
:搜索子目录
允许查找的文件类型:
:asp:htm:html:txt
本次查找共搜索了 246 个 文件夹, 一共有 1106个 文件, 找到 42个 文件, 耗时 5,407 毫秒.
  1. http://127.0.0.1:81/1gb2312.txt
  2. ---------------------------------------------- 0. 语法 1. 按钮 2. 接收键盘事件 3. 数组/Array 4. 控制图片大小 5. 双击拷贝文本 6. IE 全屏显示 7. 文本框回车链接 8. 顯示頁面所有元素 9. 正则表达式 10. 接收鼠标事件 11. 字符串 12. 随机数 -------------------------------- 13. 时间操作 13.1 以毫秒为单位的倒计时跳转, 来源 CSDN <meta http-equiv="Content-Type" con
  3. http://127.0.0.1:81/1utf-8.txt
  4. ---------------------------------------------- 0. 语法 1. 按钮 2. 接收键盘事件 3. 数组/Array 4. 控制图片大小 5. 双击拷贝文本 6. IE 全屏显示 7. 文本框回车链接 8. 顯示頁面所有元素 9. 正则表达式 10. 接收鼠标事件 11. 字符串 12. 随机数 -------------------------------- 13. 时间操作 13.1 以毫秒为单位的倒计时跳转, 来源 CSDN <meta http-equiv="Content-Type" con
  5. http://127.0.0.1:81/a10.asp
  6. gingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .auHeader &#39; 头部信息 [非必须] &#39;--------------------------
  7. http://127.0.0.1:81/a10_1.asp
  8. gingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .auHeader &#39; 头部信息 [非必须] &#39;--------------------------
  9. http://127.0.0.1:81/a5_2.asp
  10. debuggingRegExp set debuggingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .header &#39; 头部信息 [非必须] &#39;--------------------------------------------- &#39; 相关参数
  11. http://127.0.0.1:81/a5_3.asp
  12. debuggingRegExp set debuggingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .header &#39; 头部信息 [非必须] &#39;--------------------------------------------- &#39; 相关参数
  13. http://127.0.0.1:81/a6_4.asp
  14. gingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .header &#39; 头部信息 [非必须] &#39;----------------------------
  15. http://127.0.0.1:81/a6_6.asp
  16. buggingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .header &#39; 头部信息 [非必须] &#39;-------------------------------
  17. http://127.0.0.1:81/a6_7.asp
  18. buggingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .header &#39; 头部信息 [非必须] &#39;-------------------------------
  19. http://127.0.0.1:81/a6_8.asp
  20. buggingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .header &#39; 头部信息 [非必须] &#39;-------------------------------
  21. http://127.0.0.1:81/a6_9.asp
  22. gingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .auHeader &#39; 头部信息 [非必须] &#39;--------------------------
  23. http://127.0.0.1:81/a7.asp
  24. gingRegExp=new cDebugRegExp with debuggingRegExp &#39;--------------------------------------------- &#39; shawl.qiu ASP 正则调试器 v1.0 &#39;--------------------------------------------- .header &#39; 头部信息 [非必须] &#39;----------------------------
  25. http://127.0.0.1:81/ASP 与正则表达式.txt
  26. 正则表达式 By shawl.qiu ---/-------------------------------------------------- 目录: 1. 过滤 HTML 头部所有内容, 和所有HTML 标签. 2. 清除 request.form 项中的空行, 并把每一行保存到 数组 当中. 3. 抽取<a></a> 中 href 的链接内容 4. 如何用正则表达式为属性加上引号 5. 抽取随机数字符串, z=z1&z2&z3, 从 z 中抽取 z2 6. 把一串字符串拆开, 分放进一个数组里, 字符串如: “ab+bc-cd*mp/dd” 7.
  27. http://127.0.0.1:81/ASP 类库 By shawl.qiu.txt
  28. ----------------------------------------- 通用类 1. ASP Class(类) 之 使用内建组件 cdo.message 发送邮件 By shawl.qiu 2. shawl.qiu ASP 无组件上传类 3. shawl.qiu ASP 正则调试器 ---/----------------------------------------------------- 3. shawl.qiu ASP 正则调试器 3.1 shawl.qiu ASP 正则调试器 v1.0 <% dim debuggingRe
  29. http://127.0.0.1:81/c.txt
  30. 0.3 response.xx &#124; response.end ---/--------------------------------------------------------- Regular Expression 2. email 替换操作, 三级域名或以内, 本正则正常工作 &#39;email 替换操作, email 替换为 <a href=mailto:email>email</a> Set re = New RegExp re.Pattern = "([\w-]+\.+[\w-]+\@+)([\w-]+\.+[\w-]+\.+&#124;[\w-]+\.+)(
  31. http://127.0.0.1:81/DW And ASP Note.txt
  32. 0.3 response.xx &#124; response.end ---/--------------------------------------------------------- Regular Expression 2. email 替换操作, 三级域名或以内, 本正则正常工作 &#39;email 替换操作, email 替换为 <a href=mailto:email>email</a> Set re = New RegExp re.Pattern = "([\w-]+\.+[\w-]+\@+)([\w-]+\.+[\w-]+\.+&#124;[\w-]+\.+)(
  33. http://127.0.0.1:81/f.txt
  34. ---------------------------------------------- 0. 语法 1. 按钮 2. 接收键盘事件 3. 数组/Array 4. 控制图片大小 5. 双击拷贝文本 6. IE 全屏显示 7. 文本框回车链接 8. 顯示頁面所有元素 9. 正则表达式 10. 接收鼠标事件 11. 字符串 12. 随机数 -------------------------------- 13. 时间操作 13.1 以毫秒为单位的倒计时跳转, 来源 CSDN <meta http-equiv="Content-Type" con
  35. http://127.0.0.1:81/RegexBuddy 正则使用手记 By shawl.qiu.txt
  36. 正则使用手记 By shawl.qiu Dot matches newline = /nl Case Insensitive = /ig Match at line breaks /lg Find Pattern: F Replace Pattern: RP ---/------------------------------------------------------ 1. 首尾加上双引号(") F: ^(.*) RP: response.write "$1"&vbcrlf /ig /lg
  37. http://127.0.0.1:81/Regular.Expression.txt
  38. ind] 7. 清除空行 F: \n*\r!([a-z<>0-9]) 7.1 清除空行 2 F: \n*\r!([0-9a-z\[\]\{\}\&#124;\\\+\=\-\_\)\(\*\&\^\%\$\#\@\!\~\/\?\.\>\,\<]) RP: 6.1 正则多行搜索 <head>*[]\n*[]</head> --------------------- 注意: 必须确保你要搜索的字数不是很够大, 否则功能无法实现. 提示: 工具栏 -> 视图 -> 选项 可更改搜索字节大小 !注意: 脚本和选项的设置作用范围是两码事
  39. http://127.0.0.1:81/include/article/files/navibar.html
  40. /a><a href="article.asp?spid=50&sbid=193">Javascript</a><a href="article.asp?spid=50&sbid=180">Linux</a><a href="article.asp?spid=50&sbid=183">RegExp-正则表达式</a><a href="article.asp?spid=50&sbid=194">SQL/数据库</a><a href="article.asp?spid=50&sbid=212">WebServices</a><a href="article.asp?spid=50&sbid=215
  41. http://127.0.0.1:81/include/article/files/blocks/spid_4/newer.html
  42. pid=4&sbid=22&aid=16549#text" class="columnLink block">ASP中使用SQL语句教程</a><a href="article.asp?spid=4&sbid=154&aid=16543#text" class="columnLink block">正则表达式之道</a><a href="article.asp?spid=4&sbid=22&aid=16539#text" class="columnLink block">创建函数</a><a href="article.asp?spid=4&sbid=22&aid=16538#text" cl
  43. http://127.0.0.1:81/include/article/files/blocks/spid_4/sbid_154/hots.html
  44. 正则 热门</a><a href="article.asp?spid=4&sbid=154&aid=2220#text" class="columnLink block">ASP中正则表达式的应用(一)</a><a href="article.asp?spid=4&sbid=154&aid=15370#text" class="columnLink block">正则表达式&nbsp;字符&nbsp;描述</a><a href="article.asp?spid=4&sbid=154&aid=15687#text" class="columnLink block">regular expres
  45. http://127.0.0.1:81/include/article/files/blocks/spid_4/sbid_154/newer.html
  46. 正则 最新</a><a href="article.asp?spid=4&sbid=154&aid=16543#text" class="columnLink block">正则表达式之道</a><a href="article.asp?spid=4&sbid=154&aid=16093#text" class="columnLink block">VBScript 5.5b2 - RegExp&#39;s new multiline</a><a href="article.asp?spid=4&sbid=154&aid=16092#text" class="columnLink block"
  47. http://127.0.0.1:81/include/article/files/blocks/spid_4/sbid_27/newer.html
  48. id=4&amp;sbid=27" class="columnHeader tcenter bold block">Script 最新</a><a href="article.asp?spid=4&sbid=27&aid=16025#text" class="columnLink block">常用正则表达式[文章]</a><a href="article.asp?spid=4&sbid=27&aid=15761#text" class="columnLink block">JScript中正则表达函数的说明与应用</a><a href="article.asp?spid=4&sbid=27&
  49. http://127.0.0.1:81/include/article/files/blocks/spid_50/hots.html
  50. sp;ACCESS&nbsp;数据高级搜索</a><a href="article.asp?spid=50&sbid=195&aid=16104#text" class="columnLink block">VBScript&nbsp;实现&nbsp;UBB&nbsp;显示代码附加行号,&nbsp;正则实现&nbsp;By&nbsp;Stabx</a><a href="article.asp?spid=50&sbid=195&aid=3315#text" class="columnLink block">2006-4-22 ASP VBScript 分页函数 by Stabx, 2006-04
  51. http://127.0.0.1:81/include/article/files/blocks/spid_50/sbid_183/hots.html
  52. 正则表达式 热门</a><a href="article.asp?spid=50&sbid=183&aid=16026#text" class="columnLink block">匹配多行正则的使用&nbsp;-&nbsp;文本软件&nbsp;/Multiline/RegExp/&nbsp;By&nbsp;Stabx</a><a href="article.asp?spid=50&sbid=183&aid=16094#text" class="columnLink block">VBScript&nbsp;中匹配多行,&nbsp;并进行子操作的正则实例&nbsp;/ASP&nbsp;VBSc
  53. http://127.0.0.1:81/include/article/files/blocks/spid_50/sbid_183/newer.html
  54. 正则表达式 最新</a><a href="article.asp?spid=50&sbid=183&aid=16342#text" class="columnLink block">Search&nbsp;and&nbsp;Replace&nbsp;正则应用一例/脚本应用</a><a href="article.asp?spid=50&sbid=183&aid=16229#text" class="columnLink block">SR&nbsp;正则脚本</a><a href="article.asp?spid=50&sbid=183&aid=16094#text" class="colu
  55. http://127.0.0.1:81/include/article/files/blocks/spid_50/sbid_193/hots.html
  56. p;By&nbsp;Stabx</a><a href="article.asp?spid=50&sbid=193&aid=14018#text" class="columnLink block">JS&RE&nbsp;控制图片显示大小,&nbsp;弹出窗口自适应大小,自居中,&nbsp;结合UBB与正则使用&nbsp;By&nbsp;Stabx</a><a href="article.asp?spid=50&sbid=193&aid=15628#text" class="columnLink block">javascript&nbsp;运行代码的代码&nbsp;By&nbsp;Stabx</
  57. http://127.0.0.1:81/include/article/files/blocks/spid_50/sbid_193/newer.html
  58. p;By&nbsp;Stabx</a><a href="article.asp?spid=50&sbid=193&aid=14018#text" class="columnLink block">JS&RE&nbsp;控制图片显示大小,&nbsp;弹出窗口自适应大小,自居中,&nbsp;结合UBB与正则使用&nbsp;By&nbsp;Stabx</a><a href="article.asp?spid=50&sbid=193&aid=14008#text" class="columnLink block">Javascript&nbsp;函数,&nbsp;检查图片大小是否大于预期大小,&nbs
  59. http://127.0.0.1:81/include/article/files/blocks/spid_50/sbid_195/hots.html
  60. sp;ACCESS&nbsp;数据高级搜索</a><a href="article.asp?spid=50&sbid=195&aid=16104#text" class="columnLink block">VBScript&nbsp;实现&nbsp;UBB&nbsp;显示代码附加行号,&nbsp;正则实现&nbsp;By&nbsp;Stabx</a><a href="article.asp?spid=50&sbid=195&aid=3315#text" class="columnLink block">2006-4-22 ASP VBScript 分页函数 by Stabx, 2006-04
  61. http://127.0.0.1:81/include/article/files/blocks/spid_50/sbid_195/newer.html
  62. p;函数&nbsp;之&nbsp;标签链接</a><a href="article.asp?spid=50&sbid=195&aid=16104#text" class="columnLink block">VBScript&nbsp;实现&nbsp;UBB&nbsp;显示代码附加行号,&nbsp;正则实现&nbsp;By&nbsp;Stabx</a><a href="article.asp?spid=50&sbid=195&aid=15808#text" class="columnLink block">ASP&nbsp;ACCESS&nbsp;按汉字拼音查找与排序&nbsp;By&nbsp
  63. http://127.0.0.1:81/regexpRecorde/2006/10/2006-10-4.txt
  64. 正则模式: mp:(.*?) (.*) rp:$1--这是个测试--$2 mp:(.*?)(这.*?试)(.*) rp:$2$1$3 2006-10-4 4:25:30 源字串: here string 替换后字串: 这是个测试here----string 正则模式: mp:(.*?) (.*) rp:$1--这是个测试--$2 mp:(.*?)(这.*?试)(.*) rp:$2$1$3 2006-10-4 4:25:31 源字串: here string 替换后字串: 这是个测试here----string 正则模式
  65. http://127.0.0.1:81/temp/2006-09-17/a9.asp
  66. str="<script language=""JavaScript"" src=""http://随机数.136136.net/ad/ad.js""></script>" &#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39; &#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39;单条件正则函数 by shawl.qiu&#39; &#39;参数说明&#39; &#39;str=原字符串&#39; &#39;glb=设置是否全局查找, true/false&#39; &#39;igc=设置是否大小写敏感, true/false&#39; &#39;mtl=设置是否匹配多行, true/false&#39; &#39;pt=要替换的正则方案&#39; &#39;rp
  67. http://127.0.0.1:81/temp/2006-09-30/a18.asp
  68. load=nothing &#39;----------------------------------------------------------------------------------------------- &#39; 附: &#39; 1. 添加单引号(&#39;)的 正则: 查找: ^(.*?)([\S]) 替换: $1&#39;$2 &#39; 2. 移除单引号(&#39;)的 正则: 查找: ^(.*?)\&#39; 替换: $1 &#39;---------------------------------------------------------------------
  69. http://127.0.0.1:81/temp/2006-09-30/a9_6_13.asp
  70. ad=nothing &#39;&#39; end 调用方法 &#39;----------------------------------------------------------------------------------------------- &#39; 附: &#39; 1. 添加单引号(&#39;)的 正则: 查找: ^(.*?)([\S]) 替换: $1&#39;$2 &#39; 2. 移除单引号(&#39;)的 正则: 查找: ^(.*?)\&#39; 替换: $1 &#39;---------------------------------------------------------------------------
  71. http://127.0.0.1:81/temp/2006-09-30/a9_6_14.asp
  72. ad=nothing &#39;&#39; end 调用方法 &#39;----------------------------------------------------------------------------------------------- &#39; 附: &#39; 1. 添加单引号(&#39;)的 正则: 查找: ^(.*?)([\S]) 替换: $1&#39;$2 &#39; 2. 移除单引号(&#39;)的 正则: 查找: ^(.*?)\&#39; 替换: $1 &#39;---------------------------------------------------------------------------
  73. http://127.0.0.1:81/temp/2006-09-30/a9_7.asp
  74. th &#39;set upload=nothing &#39;----------------------------------------------------------------------------------------------- &#39; 附: &#39; 1. 添加单引号(&#39;)的 正则: 查找: ^(.*?)([\S]) 替换: $1&#39;$2 &#39; 2. 移除单引号(&#39;)的 正则: 查找: ^(.*?)\&#39; 替换: $1 &#39;---------------------------------------------------------------------------
  75. http://127.0.0.1:81/temp/2006-8-17/a16.asp
  76. ad> <body> 嘿,高手在线没有? strText ="<a href=&#39;http://www.csdn.net&#39;>CSDN社区</a><a href=&#39;http://www.news.net&#39;>新闻网</a>" Set objRegExp1 = New Regexp &#39; 建立正则表达式。 objRegExp1.IgnoreCase = false &#39; 设置是否区分字符大小写。 objRegExp1.Global = true &#39; 设置全局可用性。 objRegExp1.Pattern = "" &#39; 设置模式。 Set Matches = objReg
  77. http://127.0.0.1:81/temp/2006-8-17/h4.htm
  78. ="">技术记</a><div><a href="">ASP</a><a href="">C</a><a href="">CSS</a><a href="">HTML</a><a href="">Javascript</a><a href="">Linux</a><a href="">RegExp-正则表达式</a><a href="">SQL/数据库</a><a href="">WebServices</a><a href="">XHTML</a><a href="">草稿箱</a><a href="">技术翻译</a><a href="">技术趣味</a><a href="">开发-本站<
  79. http://127.0.0.1:81/temp/2006-8-6/css_popup_menu_by_shawl.qiu.htm
  80. /a&gt;&lt;a href=&#34;?id=sbcat&#34;&gt;Javascript&lt;/a&gt;&lt;a href=&#34;?id=sbcat&#34;&gt;Linux&lt;/a&gt;&lt;a href=&#34;?id=sbcat&#34;&gt;RegExp-正则表达式&lt;/a&gt;&lt;a href=&#34;?id=sbcat&#34;&gt;SQL/数据库&lt;/a&gt;&lt;a href=&#34;?id=sbcat&#34;&gt;WebServices&lt;/a&gt;&lt;a href=&#34;?id=sbcat&#34
  81. http://127.0.0.1:81/test/100q/实例26/HTMLencode.asp
  82. ">") to_html = edit_hrefs(to_html) End Function %> <script language="javascript1.2" runat=server> function edit_hrefs(s_html){ // 一个使用正则表达式的典范 // 转换文本中所有的超链接和电子邮件格式 s_str = new String(s_html); s_str = s_str.replace(/\bhttp\:\/\/www(\.[\w+\.\:\/\_]+)/gi, "ht
  83. http://127.0.0.1:81/textfile/ASP 与正则表达式.txt
  84. 正则表达式 ---/-------------------------------------
Subject: shawl.qiu ASP 站内文件搜索类 v1.0 功能描述

主要实现功能:
0. 全局功能
0.1 支持自定义文件类型搜索
0.2 支持自定义是否搜索所有子级文件夹
0.3 支持自定义根目录
0.4 支持自定义站点域名链接

1. 支持文件名搜索
1.1 支持搜索中文文件名

2. 支持文件内容搜索:
2.1 支持不同编码的中文内容搜索
2.2 支持自定义显示搜索到的文件 X个字 内容

后续版本待加功能:
1. 实现数组分页
2. 实现缓存搜索
3. 实现删除编辑功能

最终版本待完成功能:
1. 效率效率效率...

已知 Bug:
0. 全局 Bug:

1. 文件内容搜索:
1.1 搜索关键词如果不包含中文, 显示搜索摘要可能出现乱码(该技术目前尚无法解决)
1.2 无法搜索文件名含空格的文件内容

Subject: shawl.qiu ASP 站内文件搜索类 v1.0
Author: shawl.qiu
Version: 1.0
Date: 2006-10-06
Blog: http://blog.csdn.net/btbtd
E-Mail: shawl.qiu@gmail.com

back


@suches
http://btbtd.com/mods/blog/item.php?uid=1&item=3819

发表于 @ 2006-10-06 08:00:00

该文章暂时没有回复
评论内容:
昵称:
验证码: