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

手机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-24
  8. '****************************************************
  9. server.ScriptTimeout = 600
  10. Dim Report, Sun, SumFiles
  11. Sun = 0
  12. SumFiles = 0
  13. timer1 = timer
  14. If request.Form("filename")="" Then
  15. response.Write("<div style='font-size:12px;font-weight:bold;border:1px solid #006;padding:6px;background:#fcc'>条件不完全,恕难从命<br><br><a href='javascript:history.go(-1);'>请返回重新输入</a></div>")
  16. response.End()
  17. End If
  18. Set FSOc = CreateObject("Scripting.FileSystemObject")
  19. If Not fsoc.FileExists(Server.MapPath(Request.Form("filename"))) Then
  20. response.Write("<div style='font-size:12px;font-weight:bold;border:1px solid #006;padding:6px;background:#fcc'>你提供的文件 "&Request.Form("filename")&" 不存在<br><br><a href='javascript:history.go(-1);'>请返回重新输入</a></div>")
  21. response.End()
  22. End If
  23. Set tStream = Server.CreateObject("ADODB.Stream")
  24. tStream.type = 2
  25. tStream.mode = 3
  26. tStream.open
  27. tStream.Position = 0
  28. tStream.LoadFromFile Server.MapPath(Request.Form("filename"))
  29. tStream.charset = "GB2312"
  30. tStream.SkipLine
  31. tStream.SkipLine
  32. DimFileExt = Replace(tStream.ReadText(-2), "@FileType:", "")
  33. xtmp = tStream.ReadText(-2)
  34. TmpPath = Mid(xtmp, 2, InStr(xtmp, ">") - 2 )
  35. FileTxt = xtmp & vbcrlf & tStream.ReadText()
  36. tStream.close()
  37. Set tStream = Nothing
  38. Call ShowAllFile(TmpPath)
  39. %>
  40. <html>
  41. <head>
  42. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  43. <link rel="stylesheet" rev="stylesheet" href="inc/control.css" type="text/css" media="all" />
  44. </head>
  45. <body class="ContentBody">
  46. <div class="MainDiv">
  47. <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  48.   <tr>
  49.     <th class="CTitle">雷客图ASP站长安全助手 文件校验结果
  50.   </tr>
  51.   <tr>
  52.     <td class="CPanel">
  53.         <div id="updateInfo" style="background:ffffe1;border:1px solid #89441f;padding:4px;display:none"></div>
  54. 校验完毕!一共检查文件<font color="#FF0000"><%=SumFiles%></font>个,发现新增/改动的<font color="#FF0000"><%=Sun%></font>个
  55. <form name="form1" method="post" action="admin_fileinfo2.asp">
  56. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  57.  <tr>
  58.  <td valign="top" style="padding:5px;width:140px"><img src="images/Icon/ControlPanel.png" width="128" height="128"/></td>
  59.  <td valign="top">
  60.  <table width="100%" border="1" cellpadding="0" cellspacing="0" style="padding:5px;line-height:170%;clear:both;font-size:12px">
  61.  <tr>
  62.    <td width="35%">文件相对路径</td>
  63.    <td width="15%">文件大小 bytes</td>
  64.    <td width="50%">创建/修改时间</td>
  65.    </tr>
  66.      <p>
  67.  <%=Report%>
  68.  <br/></p>
  69.  </table>
  70.    </td>
  71.  </tr>
  72. </table>
  73. </form>
  74. </td></tr>
  75. </table>
  76. </div>
  77. <%
  78. timer2 = timer
  79. thetime=cstr(int(((timer2-timer1)*10000 )+0.5)/10)
  80. response.write "<br><font size=""2"">本页执行共用了"&thetime&"毫秒</font>"
  81. %>
  82. </body>
  83. </html>
  84. <%
  85. Sub ShowAllFile(Path)
  86. xlake2 = replace(path,"","\")
  87. xlake2 = replace(xlake2,"+","+")
  88. xlake2 = replace(xlake2,".",".")
  89. xlake2 = replace(xlake2,"[","[")
  90. xlake2 = replace(xlake2,"]","]")
  91. xlake2 = replace(xlake2,"{","{")
  92. xlake2 = replace(xlake2,"}","}")
  93. Set FSO = CreateObject("Scripting.FileSystemObject")
  94. if not fso.FolderExists(path) then exit sub
  95. Set regEx = New RegExp
  96. regEx.IgnoreCase = True
  97. regEx.Global = True
  98. regEx.Pattern = "<"&xlake2&">.*"
  99. Set Matches = regEx.Execute(filetxt)
  100. For Each Match in Matches
  101. Lake2 = Replace(Replace(Match.Value, vbcrlf, ""), "<"&Path&">", "")
  102. Next
  103. Set Matches = Nothing
  104. Set regEx = Nothing
  105. Set f = FSO.GetFolder(Path)
  106. Set fc2 = f.files
  107. For Each myfile in fc2
  108. SumFiles = SumFiles + 1
  109. If CheckExt(FSO.GetExtensionName(path&""&myfile.name)) Then
  110. Temp = myfile.name&"*"&myfile.Size&"*"&myfile.DateLastModified&"|"
  111. If InStr(1, Lake2, Temp, 1) = 0 Then
  112. Sun = Sun + 1
  113. Report = Report&"<tr><td><a href=""http://"&Request.Servervariables("server_name")&"/"&Replace(replace(Path,server.MapPath("")&"","",1,1,1),"","/")&"/"&tURLEncode(myfile.name)&""" target=_blank>"&replace(Path,server.MapPath("")&"","",1,1,1)&""&myfile.name&"</a></td><td>"&myfile.Size&"</td><td>"&myfile.DateLastModified&"<br>"&myfile.DateLastModified&"</td></tr>"
  114. End If
  115. End If
  116. Next
  117. Set fc = f.SubFolders
  118. For Each f1 in fc
  119. ShowAllFile path&""&f1.name
  120.     Next
  121. Set FSO = Nothing
  122. End Sub
  123. %>