%
' Option Explicit
Response.Buffer = True
' Set up some FileSystem objects.
dim objFS, objFolder, objFiles, File, FileName, objCheckFile, strSitePath
set objFS = server.CreateObject("Scripting.FileSystemObject")
dim strListofFiles, arrFileList, strPageTitle, iReturnCount
dim objFolders
strListofFiles = ""
iReturnCount = 0
' The search values, search space, and the return value
dim strKeyWord, strFileContents, returnValue, arrKeyWords
dim bKeyWordFound, i, j
' Get the Physical path to the current directory
strSitePath = Server.MapPath(".")
' Grab the keyworlds and split them into an array
strKeyWord = Trim(request.form("x"))
arrKeyWords = split(strKeyWord,"")
'RESPONSE.WRITE strKeyWord
' Get the list of files.
Set objFolder = objFS.GetFolder(strSitePath)
'response.write strSitePath
' Sub that grabs all the ".htm" & ".html" files in the given folder and
' recurses through all subfolders.
sub getCompleteFileList(inFolder, Path)
dim oFiles, oFolders, Folder, sPath
' Get all the files and subfolders.
Set oFiles = inFolder.Files
Set oFolders = inFolder.SubFolders
' If we have a subfolder we need the partial path
if (Path <> "") then
sPath = Path + "\"
end if
' Add each ".htm" & ".html" file to the list
For Each File in oFiles
FileName = File.Name
'response.write filename & " "
if((Lcase(right(FileName,5)) = ".html") OR (Lcase(right(FileName,4)) = ".htm")) then
if (strListofFiles = "") then
strListofFiles = sPath + FileName
else
strListofFiles = strListofFiles + "," + sPath + FileName
end if
end if
Next
' Check all the subfolders for ".htm" & ".html" files
For Each Folder in oFolders
if (Folder.Name <> "images" AND Folder.Name <> "_VTI_CNF" AND Folder.Name <> "SWF" AND Folder.Name <> "DOWNLOAD") then
call getCompleteFileList(Folder, sPath + Folder.Name)
end if
Next
' Clean up
set File = Nothing
set oFiles = Nothing
set Folder = Nothing
set oFolders = Nothing
end sub
%>