Home | Advertising Info64 USERS CURRENTLY ONLINE   
   Site Search Contact Us Saturday, September 20, 2014  
 
 


 
ASPProtect
User Management Application with web based screens that allow you to manage users.
www.ASPProtect.com
 
ASPBanner
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
www.ASPBanner.com
 
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
www.ASPPhotoGallery.com
 
ASPClassifieds
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.
www.ASPClassifieds.com



DISCUSSION ARCHIVES
 
Try a free httpZip trial now and compress for less!


We didn't realize
the site was so popular.

Other Stuff
 

 
 
Active Server Pages asp search engine active server page asp application components tutorial CJWSoft ASPProtect ASPBanner ASPClassifieds



(Advanced)  (Components)  (Database)  (General)  (Vbscript)




ASPProtect

 
Subject: Re: Searching with FileSystemObject
From: Jaspal Khanna
Date: 8/2/2000 6:42:29 AM
IP: 194.170.163.106



 

Using the FileSystemObject, you can search through all of the files in a particular directory that contain a particular string. To allow for this functionality, you will need two ASP pages: one that presents the user a form to enter the string they wish to search for; the second needs to take this string, iterate through all of the files in a particular folder, and determine which of these files contain the string. Well start by coding the first ASP page, Search.asp, which contains a simple form:

<HTML>
<BODY>
<FORM METHOD=POST ACTION="TextSearch.asp">
Enter text to search for:
<INPUT TYPE=TEXT NAME=SearchText>
<P>
<INPUT TYPE=SUBMIT VALUE="Begin Search!">
</FORM>
</BODY>
</HTML>

TextSearch.asp!

<HTML><BODY>
<B>Search Results for <%=Request("SearchText")%></B><BR>
<%
Const fsoForReading = 1
Dim strSearchText
strSearchText = Request("SearchText")
Now, we want to search all of the files
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 & _
""">" & ob

Previous Message

Follow Up - Re: Searching with FileSystemObject te page is not enough - jaspal khanna 8/2/2000 6:45:48 AM


 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2014 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com