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

手机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-19
  7. ' Update:2006-7-22
  8. '****************************************************
  9. server.ScriptTimeout = 600
  10. Dim Report
  11. if request.Form("filepath")="" then
  12. TmpPath = Server.MapPath("")
  13. elseif request.Form("filepath")="." then
  14. TmpPath = Server.MapPath(".")
  15. else
  16. TmpPath = Server.MapPath("")&""&request.Form("filepath")
  17. end if
  18. %>
  19. <html>
  20. <head>
  21. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  22. <link rel="stylesheet" rev="stylesheet" href="inc/control.css" type="text/css" media="all" />
  23. </head>
  24. <body class="ContentBody">
  25. <div class="MainDiv">
  26. <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  27.   <tr>
  28.     <th class="CTitle">雷客图ASP站长安全助手 提取文件信息
  29.   </tr>
  30.   <tr>
  31.     <td class="CPanel">
  32.         <div id="updateInfo" style="background:ffffe1;border:1px solid #89441f;padding:4px;display:none"></div>
  33. <form name="form1" method="post" action="admin_fileinfo2.asp">
  34. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  35.  <tr>
  36.  <td valign="top" style="padding:5px;width:140px"><img src="images/Icon/ControlPanel.png" width="128" height="128"/></td>
  37.  <td valign="top">
  38.  <div align="left" style="padding:5px;line-height:170%;clear:both;font-size:12px">
  39. <%
  40. If request.Form("filepath") = "" or request.Form("FileExt") = "" Then
  41. response.Write("条件不完全,恕难从命<br><br><a href='javascript:history.go(-1);'>请返回重新输入</a>")
  42. response.End()
  43. End If
  44. DimFileExt = request.Form("fileExt")
  45. Report = "@本文件由“雷客图ASP站长安全助手”生成;请妥善保存,以备后用"&vbcrlf&"@"&Now&vbcrlf&"@FileType:"&DimFileExt&vbcrlf
  46. Report = Report&"<" & TmpPath & ">"
  47. Call ShowAllFile(TmpPath)
  48. DownFile(Report)
  49. %> 
  50.      <p>
  51.      </p>
  52.    </div></td>
  53.  </tr>
  54. </table>
  55. </form>
  56. </td></tr>
  57. </table>
  58. </div>
  59. </body>
  60. </html>
  61. <%
  62. Sub ShowAllFile(Path)
  63. Set FSO = CreateObject("Scripting.FileSystemObject")
  64. if not fso.FolderExists(path) then exit sub
  65. Set f = FSO.GetFolder(Path)
  66. Set fc2 = f.files
  67. For Each myfile in fc2
  68. If CheckExt(FSO.GetExtensionName(path&""&myfile.name)) Then
  69. Report = Report&myfile.name&"*"&myfile.Size&"*"&myfile.DateLastModified&"|"
  70. End If
  71. Next
  72. Set fc = f.SubFolders
  73. For Each f1 in fc
  74. Report = Report&vbcrlf&"<"&path&""&f1.name&">"
  75. ShowAllFile path&""&f1.name
  76.     Next
  77. Set FSO = Nothing
  78. End Sub
  79. Sub DownFile(Str)
  80. Response.Clear()
  81. Response.AddHeader "Content-Disposition", "attachment; filename="& Replace(Replace(Replace(Replace(now,"/",""),":",""),"-","")," ","") &".txt"
  82. Response.ContentType="application/ms-download"
  83. Response.Write(Str)
  84. Response.End()
  85. End Sub
  86. %>