<html>
<head>
<title>Path Finder</title>
</head>
<body>
<!--#INCLUDE Virtual="xxxxxxxxxx/inc_sha256.asp"-->
<%
Response.Buffer = False
Server.ScriptTimeout = 900
Const FOR_READING = 1
dim ng
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=XXXXXXXXXXXX"
strDBType = "access"
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
if Request.Form("Pass") <> "" and Request.Form("User") <> "" then
strSQL="SELECT EMP_ID, EMP_NAME, EMP_FIRSTNAME, EMP_LASTNAME, EMP_PASSWORD FROM EMPLOYEES WHERE EMP_NAME = '" & Request.Form("User") & "'"
set rsAuthenticate=my_Conn.Execute(strSQL)
if not rsAuthenticate.EOF then
strLegalUser=rsAuthenticate("EMP_NAME")
strLegalFirst=rsAuthenticate("EMP_FIRSTNAME")
strLegalLast=rsAuthenticate("EMP_LASTNAME")
strLegalPass=rsAuthenticate("EMP_PASSWORD")
intID=rsAuthenticate("EMP_ID")
rsAuthenticate.Close
end if
Set rsAuthenticate = Nothing
if (sha256(Request.Form("Pass")) <> strLegalPass) then
Response.Write "Access denied!" & vbNewLine & _
" <meta http-equiv=""Refresh"" content=""6; URL=Searcher.asp"">" & vbNewLine
Response.End
else
Response.Write "<table align=""center"" width=""950""><tr valign=""middle""><td align=""left"">Hi " & strLegalFirst & " " & strLegalLast & ", </center><br></td></tr></table>"
Dim strPath ' Path of directory to search
Dim objFSO ' FileSystemObject variable
Dim objFolder ' Folder variable
Dim objItem ' Variable used to loop through the contents of the folder
Dim strQuery ' Search string
for i = 67 to 91 ' Drives C - Z
if Request.Form("HDISK" & chr(i)) = "on" then
strPath = "HDISK" & chr(i) & "/"
if strQuery = "" then strQuery = Request.Form("query")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(strPath))
%>
<table align="center" width="950" border="0" cellspacing="0" cellpadding="2">
<tr valign="middle">
<td align="left" width="70%"> Here are the contents of <strong>HDisk <%= chr(i) %></strong> that match your query:
</td>
<td width="10%"> </td>
<td width="20%"> </td>
</tr>
</table>
<table align="center" width="950" border="5" bordercolor="green" cellspacing="0" cellpadding="2">
<tr bgcolor="#006600">
<td width="70%"><font color="#FFFFFF"><strong>File Name:</strong></font></td>
<td width="10%"><font color="#FFFFFF"><strong>File Size:</strong></font></td>
<td width="20%"><font color="#FFFFFF"><strong>Date Created:</strong></font></td>
</tr>
<%
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(strPath))
Set colFiles = objFolder.Files
For Each objItem In colFiles
If InStr(1, objItem.Name, strQuery, vbTextCompare) <> 0 Then
%>
<tr bgcolor="#CCFFCC">
<td width="70%" align="left" ><a href="<% = strPath %>/<%= objItem.Name %>"><%= objItem.Name %></a></td>
<td width="10%" align="right"><%= objItem.Size %></td>
<td width="20%" align="right" ><%= cstr(objItem.DateCreated) %></td>
</tr>
<%
End If
Next
ShowSubFolders(objFolder)
End if
Next
Sub ShowSubFolders(objFolder)
Set colFolders = objFolder.SubFolders
For Each objSubFolder In colFolders
strTitle=""
if not (uCase(objSubFolder.Name) = "SYSTEM VOLUME INFORMATION" or uCase(objSubFolder.Name) = "RECYCLER" or uCase(objSubFolder.Name) = "DOCUMENTS AND SETTINGS" or uCase(objSubFolder.Name) = "MSOCACHE" or uCase(objSubFolder.Name) = "CONFIG.MSI") then
Set colFiles = objSubFolder.Files
If InStr(1, objSubFolder.Name, strQuery, vbTextCompare) <> 0 Then
strTitle=mid(objSubFolder,4)
strTitle=replace(strTitle,"\","/") & "/"
strLink = strPath & strTitle
%>
<tr bgcolor="#CCFFCC">
<td width="70%" align="left" ><a href="<%= strLink %>"><%= objSubFolder.Name %></a></td>
<td width="10%" align="right"> </td>
<td width="20%" align="right" > </td>
</tr>
<%
end if
if not (ObjFolder = "c:\" or objSubFolder.Name="Documents and Settings") then
strTitle=mid(objSubFolder,4)
strTitle=replace(strTitle,"\","/") & "/"
For Each objItem In colFiles
strDate = cStr(objItem.DateCreated)
if len(strDate) < 22 then
if mid(strDate,2,1) = "/" then strDate = "0" & strDate
if mid(strDate,4,1) = "/" then strDate = left(strDate,2) & "0" & mid(strDate,3)
if mid(strDate,13,1) = ":" then strDate = left(strDate,11) & "0" & mid(strDate,12)
end if
If InStr(1, objItem.Name, strQuery, vbTextCompare) <> 0 Then
strLink = strPath & strTitle & objItem.Name
%>
<tr bgcolor="#CCFFCC">
<td width="70%" align="left" ><a href="<% = strLink %>"><%= objItem.Name %></a></td>
<td width="10%" align="right"><%= objItem.Size %></td>
<td width="20%" align="right" ><%= strDate %></td>
</tr>
<%
End If
Next
end if
ShowSubFolders(objSubFolder)
end if
Next
End Sub
Set objItem = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
Response.Write "</table>"
end if
else
Response.Write "<form action=""Searcher.asp"" method=""post"" id=""authenticate"">" & vbNewLine & _
" <table align=""center"" width=""50%"" style=""border-collapse: collapse"" border=""1"" cellpadding=""5"" cellspacing=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""50%"" bgcolor=""cyan"">" & vbNewLine & _
" <font face=""arial bold"" size=""4"" color=""black"">User Name" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""50%"" bgcolor=""cyan"">" & vbNewLine & _
" <font face=""arial bold"" size=""4"" color=""black"">Password" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""50%"" bgcolor=""cyan"">" & vbNewLine & _
" <font face=""arial bold"" size=""2"" color=""black"">" & vbNewLine & _
" <input type=""text"" name=""User"" size=""20"" maxlength=""50"">" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""50%"" bgcolor=""cyan"">" & vbNewLine & _
" <font face=""arial bold"" size=""2"" color=""black"">" & vbNewLine & _
" <input type=""password"" name=""Pass"" size=""20"" maxlength=""50"">" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" bgcolor=""cyan"">" & vbNewLine & _
" <font face=""arial"" size=""2"" color=""navy"">Find files whose names contain:" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" bgcolor=""cyan"">" & vbNewLine & _
" <input type=""text"" width=""50"" maxlength=""100"" name=""query"" value=""" & strQuery & """>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" bgcolor=""cyan"">" & vbNewLine & _
" <font face=""arial"" size=""2"" color=""navy""><b>Drives to Include:</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" bgcolor=""cyan"">" & vbNewLine & _
" <font face=""arial bold"" size=""2"" color=""black"">" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKC"">C" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKD"">D" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKE"">E" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKF"">F" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKG"">G" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKH"">H" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKI"">I" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKJ"">J" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKC"">K" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKD"">L" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKE"">M" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKF"">N" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKG"">O" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKH"">P" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKI"">Q" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKJ"">R" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKC"">S" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKD"">T" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKE"">U" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKF"">V" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKG"">W" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKH"">X" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKI"">Y" & vbNewLine & _
" <input type=""checkbox"" name=""HDISKJ"">Z" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""cyan"" colspan=""2"" align=""center""><input type=""submit"" value=""Submit"" id=""submit1"" name=""submit1"">" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
end if
%>
</body>
</html>