Bonjour,
J'ai le code suivant qui fait des recherche sur le site.
Es-ce qu'il est possible d'exclure certaines extensions de fichiers ?
Sinon comment n'obtenir que des fichiers .asp,. htm, .html avec ce code?
Merci !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 <% Dim objFSO Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Dim objFolder Set objFolder = objFSO.GetFolder(Server.MapPath("/")) Dim objFile, objTextStream, strFileContents, bolFileFound bolFileFound = False For Each objFile in objFolder.Files If Response.IsClientConnected then Set objTextStream = objFSO.OpenTextFile(objFile.Path,fsoForReading) strFileContents = objTextStream.ReadAll If InStr(1,strFileContents,strSearchText,1) then Response.Write "<LI><A HREF=""/" & objFile.Name & _ """>" & objFile.Name & "</A><BR>" bolFileFound = True End If objTextStream.Close End If Next if Not bolFileFound then Response.Write "Aucun résultat ne répond à ce critère..." Set objTextStream = Nothing Set objFolder = Nothing Set objFSO = Nothing %>
Partager