Le moteur de recherche se compose d'un fichier HTM et d'un fichier ASP. Il utilise principalement le composant FileSystemObject pour atteindre son objectif. Il a des fonctions puissantes et peut être utilisé directement après avoir modifié l'interface. Bien sûr, il vaut encore mieux ajouter un peu de vos propres choses.
SearchPage.htm
Ce fichier HTM est utilisé pour passer dans la condition
<html>
<adal>
<Title> Exemple de moteur de recherche ASP </TITME>
</ Head>
<body>
<Nenter>
<Formulaire méthode = post-action = search.asp>
<Tableau BgColor = # CC6633 Border = 0>
<tr>
<Td Rowspan = 3 bgColor = # cc6633 width = 21 Nowrap> </td>
<Td width = 363 Nowrap> <font color = # fffff>
<Input type = text name = searchText size = 22>
<Entrée Type = Checkbox Name = Case>
Très sensible </font> </td>
<Td rowspan = 3 width = 10>
<Type d'entrée = soumettre Value = OK>
<p>
<Type d'entrée = réinitialiser la valeur = clear>
</td>
<Td Rowspan = 3 bgcolor = # cc6633 width = 28> </td>
</tr>
<tr>
<Td width = 363 Nowrap> <font color = # fffff> Retour Résultat
<Select name = rLength>
<Valeur d'option = 200 Sélectionnés> Message long </ option>
<Valeur d'option = 100> Message court </opoption>
<Valeur d'option = 0> Renvoyez uniquement à la connexion </ Option>
</lect>
<Select name = rresults>
<Valeur de l'option = 10 sélectionnés> 10
<Valeur de l'option = 25> 25
<Valeur de l'option = 50> 50
</lect>
</font>
</td>
</tr>
<tr>
<Td width = 363 Nowrap> <font color = # fffff> doit inclure:
<Input type = checkbox name = iImage>
image
<Input type = checkbox name = izips>
Format zip
<Entrée type = cocher name = ijavas> javascript
</font>
</td>
</tr>
</ Table>
</ form>
</ Center>
<dl>
<dd> </dd>
</dl>
</docy>
</html>
------------------------------------------------------------------------
Programme ASP qui affiche les résultats
search.asp
<html>
<adal>
Résultats de la recherche pour <Title> '<% = request (searchText)%>' </Title>
</ Head>
<body>
Résultats de la recherche pour <b> '<% = request (searchText)%>' </b> <br>
<%
Const fsoforreading = 1
Dim objfile, objfolder, objsubfolder, objTextStream
Bolume DIM, BOLFILE-FOUND, BOLTAGFOUND
Dim StrCount, Strdetag, Strext, Strfile, StrContent, StrRoot, Strtag, StrText, Strtitle, Strtitlel