<html> <head> <title> pesquisador de texto (VBS) na mesma pasta </title>
<Meta http-equiv = content-type content = text/html; charset = gb2312>
<Script Language = VBScript ID = ClientEventHandlersVBs>
<!-
Dim fso, f, f1, fc, fn, s, uf1, ufn
SUB B1_ONCLICK
fn = t1.value ''
PN = MID (Location.Pathname, 2, Len (Location.Pathname) -14)
ShowFolderList (PN)
Final sub
Função ShowFolderList (caminho)
'' MsgBox Path
Set fso = createObject (script.filesystemObject)
Set f = fso.getFolder (caminho)
Definir FC = F.Files
'' ufn = ucase (fn)
Para cada F1 no FC
FileSecec = Path & F1.Name
ReadEntirefile (FileSecec)
'' uf1 = ucase (f1.name)
'' Se Instr (uf1, ufn) <> 0 então
'' S = S & <a href = & Path & f1.name &> & f1.name & </a> <br>
'' final se
Próximo
Document.Write A seguinte entrada foi pesquisada, clique nela. [Compilado por Merber em janeiro de 2003] <br>
document.write s
Definir fc = nada
set f = nada
Defina FSO = nada
Função final
Função readentirefile (FileSecec)
Const forreading = 1
Dim FSO, TheFile, Retstring
Set fso = createObject (script.filesystemObject)
Definir o arquivo = fso.opentExtFile (FileSpec, Freading, false)
ufn = ucase (fn)
Faça enquanto thefile.atendofstream <> true
retstring = thefile.readline
uf1 = ucase (retstring)
Se Instr (uf1, ufn) <> 0 então
s = s & <a href = & path & f1.name &> & f1.name & </a> <br>
saída do
final se
Laço
thefile.close
ReadEntirefile = S.
Função final
->
</Script>
</head>
<Body>
<P align = Center> <font color =#000000 size = 6> Por favor, digite a palavra -chave para pesquisar [incluído no texto] (</font> <font
color =#000000 Tamanho = 3> Ignore Case </font> <font color =#000000 size = 6>) </font> </p>
<P align = Center> <font size = 2> <font color =#000000> [produzido por Merber
Em 5 de janeiro de 2003] </font> </font> </p>
<P align = Center> <Nome de entrada = T1> <Tipo de entrada = Valor do botão = Pesquisa! nome = b1> </p>
<P align = Center> </p> </body> </html>