Admin_SearchFiles.asp
上传用户:sking1122
上传日期:2020-09-24
资源大小:1005k
文件大小:5k
源码类别:

手机WAP编程

开发平台:

ASP/ASPX

  1. <!--#include file="admin_sb.asp"-->
  2. <!--#include file="inc/include.asp"-->
  3. <%
  4. '************** ASPSecurity 文件搜索****************
  5. ' Copyright 2006
  6. ' Create:2006-1-18
  7. ' Update:2006-8-03
  8. '***************************************************
  9. server.ScriptTimeout = 600
  10. Dim Report, Sun, SumFiles, SumFolders
  11. Sun = 0
  12. SumFiles = 0
  13. SumFolders = 1
  14. timer1 = timer
  15. if request.Form("Search_path")="" then
  16. TmpPath = Server.MapPath("")
  17. elseif request.Form("Search_path")="." then
  18. TmpPath = Server.MapPath(".")
  19. else
  20. TmpPath = Server.MapPath("")&""&request.Form("Search_path")
  21. end if
  22. %>
  23. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  24. <html>
  25. <head>
  26. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  27. <link rel="stylesheet" rev="stylesheet" href="inc/control.css" type="text/css" media="all" />
  28. </head>
  29. <body class="ContentBody">
  30. <div class="MainDiv">
  31. <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  32.   <tr>
  33.     <th class="CTitle">雷客图ASP站长安全助手 文件搜索结果
  34.   </tr>
  35.   <tr>
  36.     <td class="CPanel">
  37.         <div id="updateInfo" style="background:ffffe1;border:1px solid #89441f;padding:4px;display:none"></div>
  38. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  39.  <tr>
  40.  <td valign="top" style="padding:5px;width:140px"><img src="images/Icon/ControlPanel.png" width="128" height="128"/></td>
  41.  <td valign="top">
  42.  <div align="left" style="padding:5px;line-height:170%;clear:both;font-size:12px">
  43. <%
  44. If request.Form("Search_path") = "" or request.Form("Search_Date") = "" or request.Form("Search_FileExt") = "" Then
  45. response.Write("缉捕条件不完全,恕难从命<br><br><a href='javascript:history.go(-1);'>请返回重新输入</a>")
  46. response.End()
  47. End If
  48. DimFileExt = request.Form("Search_fileExt")
  49. Call ShowAllFile(TmpPath)
  50. %> 
  51.      <p>
  52. 扫描完毕!一共检查文件夹<font color="#FF0000"><%=SumFolders%></font>个,文件<font color="#FF0000"><%=SumFiles%></font>个,发现符合条件的<font color="#FF0000"><%=Sun%></font>个
  53.      </p>
  54.  </div>    
  55. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  56.  <tr>
  57.  <td valign="top">
  58.  <table width="100%" border="1" cellpadding="0" cellspacing="0" style="padding:5px;line-height:170%;clear:both;font-size:12px">
  59.  <tr>
  60.    <td width="50%">文件相对路径</td>
  61.    <td width="25%">文件创建时间</td>
  62.    <td width="25%">修改时间</td>
  63.    </tr>
  64.      <p>
  65.  <%=Report%>
  66.  <br/></p>
  67.  </table></td>
  68.  </tr>
  69. </table>
  70. </td></tr></table>
  71. <%
  72. timer2 = timer
  73. thetime=cstr(int(((timer2-timer1)*10000 )+0.5)/10)
  74. response.write "<br><font size=""2"">本页执行共用了"&thetime&"毫秒</font>"
  75. %>
  76. </div>
  77. </body>
  78. </html>
  79. <%
  80. Sub ShowAllFile(Path)
  81. Set FSO = CreateObject("Scripting.FileSystemObject")
  82. if not fso.FolderExists(path) then exit sub
  83. Set f = FSO.GetFolder(Path)
  84. Set fc2 = f.files
  85. For Each myfile in fc2
  86. If CheckExt(FSO.GetExtensionName(path&""&myfile.name)) Then
  87. Call IsFind(Path&""&myfile.name)
  88. SumFiles = SumFiles + 1
  89. End If
  90. Next
  91. Set fc = f.SubFolders
  92. For Each f1 in fc
  93. ShowAllFile path&""&f1.name
  94. SumFolders = SumFolders + 1
  95.     Next
  96. Set FSO = Nothing
  97. End Sub
  98. Sub IsFind(thePath)
  99. theDate = GetDateModify(thePath)
  100. on error resume next
  101. theTmp = Mid(theDate, 1, Instr(theDate, " ") - 1)
  102. if err then exit Sub
  103. xDate = Split(request.Form("Search_Date"),";")
  104. If request.Form("Search_Date") = "ALL" Then ALLTime = True
  105. For i = 0 To Ubound(xDate)
  106. If theTmp = xDate(i) or ALLTime = True Then 
  107. If request("Search_Content") <> "" Then
  108. Set tStream = Server.CreateObject("ADODB.Stream")
  109. tStream.type = 2
  110. tStream.mode = 3
  111. tStream.open
  112. tStream.Position=0
  113. tStream.LoadFromFile thePath
  114. tStream.charset = "GB2312"
  115. Do Until tStream.EOS
  116. filetxt = filetxt & LCase(replace(tStream.ReadText(102400), Chr(0), ""))
  117. Loop
  118. tStream.close()
  119. Set tStream = Nothing
  120. If Instr( filetxt, LCase(request.Form("Search_Content"))) > 0 Then
  121. temp = "<a href=""http://"&Request.Servervariables("server_name")&"/"&tURLEncode(Replace(replace(thePath,server.MapPath("")&"","",1,1,1),"","/"))&""" target=_blank>"&replace(thePath,server.MapPath("")&"","",1,1,1)&"</a>"
  122. Report = Report&"<tr><td>"&temp&"</td><td>"&GetDateCreate(thePath)&"</td><td>"&theDate&"</td></tr>"
  123. Sun = Sun + 1
  124. Exit Sub
  125. End If
  126. Set ofile = Nothing
  127. Set FSOs = Nothing
  128. Else
  129. temp = "<a href=""http://"&Request.Servervariables("server_name")&"/"&tURLEncode(Replace(replace(thePath,server.MapPath("")&"","",1,1,1),"","/"))&""" target=_blank>"&replace(thePath,server.MapPath("")&"","",1,1,1)&"</a>"
  130. Report = Report&"<tr><td>"&temp&"</td><td>"&GetDateCreate(thePath)&"</td><td>"&theDate&"</td></tr>"
  131. Sun = Sun + 1
  132. Exit Sub
  133. End If
  134. End If
  135. Next
  136. End Sub
  137. %>