by Syed Azeem Haider (1 Submission)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Wed 20th November 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Split Search. This Program is search the text in all text and html files of Windows directory and display link to view file(s)
<html>
<body>
<font face="Tahoma"> <font size="2">Split Searching by Syed Azeem Haider (Karachi)<br> Portal Developer<br>
<a href="http://www.otoscribe.com">Otoscribe Technologies</a></font></font><p>
<font face="Tahoma" size="2"> Contact: <a href="mailto:[email protected]">
[email protected]</a></font></p>
<p>
<font face="Tahoma" size="2">
This Program is search the text in all text and html files of Windows directory and display link
to view file(s).</font>
<form method="GET" action="SearchEngin.asp">
<div align="center">
<table border="1" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="36%" cellspacing="5" height="45" bgcolor="#0099FF">
<tr>
<td width="76%" height="36">
<p align="right"><font face="Verdana" size="2"><font color="#FFFFFF">Enter Search Text:</font> </font></td>
<td width="21%" height="36" align="center">
<input type="text" name="SearchText" size="16" style="border:1px solid #00FFCC; font-family:Tahoma; color:#FFFFFF; font-size:14px; background-color:#0099FF" value="<%=wrd%>"></td>
<td width="84%" height="36">
<input type="submit" value="Search" name="B1" style="cursor: hand; font-family: Tahoma; font-size: 12px; border: 1px solid #00FFCC; background-color: #0099FF; color:#FFFFFF"></td>
</tr>
</table>
</div>
</form>
</body>
</html>
<%
If Trim(wrd)<>"" Then
wrds = Split(wrd, " ")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set thisfolder = fso.GetFolder("C:\Windows")
Set sfiles = thisfolder.Files
found = False
nof=0
Response.Write "<table border='0' cellspacing='2'>"
For Each fl In sfiles
If UCase(Right(fl, 3)) = "TXT" Or UCase(Right(fl, 3)) = "HTM" Or UCase(Right(fl, 3)) = "HTML" Then
Set cfile = fso.OpenTextFile(fl)
Do While Not cfile.AtEndOfStream
ln = cfile.ReadLine()
For Each wrd In wrds
wrd = UCase(wrd)
pos = InStr(UCase(ln), wrd)
If pos > 0 Then
nof=nof+1
found = True
Response.Write "<tr><td><A Href='" & fl & "'><font face='Tahoma' size='2'>" & _
fl & "</font></A>: </td><td><font face='Tahoma' size='2'>" & ln & "</font></td><tr>"
Exit For
End If
Next
if found = True Then
found = False
Exit Do
End If
Loop
cfile.Close
End If
Next
If nof=0 Then
Response.Write "<tr><td><font face='Tahoma' color='#FF0000' size='2'><strong>No result found</strong></font></td></tr>"
End If
Response.Write "</table>"
End If
%>
No comments have been posted about Split Search. This Program is search the text in all text and html files of Windows directory and d. Why not be the first to post a comment about Split Search. This Program is search the text in all text and html files of Windows directory and d.