<Html> <A-Head> <Title> Rechercheur de texte (VBS) dans le même dossier </TITAL>
<Meta http-equiv = contenu contenu contenu = text / html; charse = gb2312>
<Script Language = VBScript ID = clientEventHandlersvbs>
<! -
DIM FSO, F, F1, FC, FN, S, UF1, UFN
Sub b1_onclick
fn = t1.value ''
pn = mid (emplacement.pathname, 2, Len (emplacement.pathname) -14)
Showfolderlist (PN)
Sub-Sub
Fonction showfolderlist (chemin)
Chemin de msgbox ''
Set fso = createObject (scripting.fileSystemObject)
Set f = fso.getfolder (chemin)
Définir FC = F.Files
'' ufn = ucase (fn)
Pour chaque F1 en FC
filespec = Path & f1.name
Readentirefile (filespec)
'' uf1 = ucase (f1.name)
'' Si instr (uf1, ufn) <> 0 alors
'' s = s & <a href = & path & f1.name &> & f1.name & </a> <br>
'' terminer si
Suivant
Document.Write L'entrée suivante a été recherchée, veuillez cliquer dessus. [Compilé par Merber en janvier 2003] <br>
document.write s
Définir FC = rien
Définir F = rien
Définir FSO = rien
Fonction finale
Fonction Readentirefile (filespec)
Const Forreading = 1
DIM FSO, TheFile, retstring
Set fso = createObject (scripting.fileSystemObject)
Set theFile = fso.OpentextFile (Filescec, ForReading, False)
ufn = ucase (fn)
Faire pendant que thefile.atendofstream <> true
retstring = thefile.readline
uf1 = ucase (retstring)
Si instr (uf1, ufn) <> 0 alors
S = s & <a href = & path & f1.name &> & f1.name & </a> <br>
sortir faire
terminer si
Boucle
thefile.close
Readentirefile = s
Fonction finale
->
</cript>
</ Head>
<body>
<P align = Center> <Font Color = # 000000 size = 6> Veuillez saisir le mot-clé pour rechercher [inclus dans le texte] (</font> <Font
color = # 000000 size = 3> ignorer le boîtier </font> <font color = # 000000 size = 6>) </font> </p>
<P align = Center> <Font size = 2> <font color = # 000000> [produit par Merber
Le 5 janvier 2003] </font> </font> </p>
<P align = Center> <Name Input = T1> <Type d'entrée = Button Value = Search! nom = b1> </p>
<P align = Center> </p> </body> </html>