admin_fileinfo3.asp
资源名称:wap.rar [点击查看]
上传用户:sking1122
上传日期:2020-09-24
资源大小:1005k
文件大小:4k
源码类别:
手机WAP编程
开发平台:
ASP/ASPX
- <!--#include file="admin_sb.asp"-->
- <!--#include file="inc/include.asp"-->
- <%
- '************** ASPSecurity 文件校验 *************
- ' Copyright 2006
- ' Create:2006-1-19
- ' Update:2006-7-24
- '****************************************************
- server.ScriptTimeout = 600
- Dim Report, Sun, SumFiles
- Sun = 0
- SumFiles = 0
- timer1 = timer
- If request.Form("filename")="" Then
- 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>")
- response.End()
- End If
- Set FSOc = CreateObject("Scripting.FileSystemObject")
- If Not fsoc.FileExists(Server.MapPath(Request.Form("filename"))) Then
- 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>")
- response.End()
- End If
- Set tStream = Server.CreateObject("ADODB.Stream")
- tStream.type = 2
- tStream.mode = 3
- tStream.open
- tStream.Position = 0
- tStream.LoadFromFile Server.MapPath(Request.Form("filename"))
- tStream.charset = "GB2312"
- tStream.SkipLine
- tStream.SkipLine
- DimFileExt = Replace(tStream.ReadText(-2), "@FileType:", "")
- xtmp = tStream.ReadText(-2)
- TmpPath = Mid(xtmp, 2, InStr(xtmp, ">") - 2 )
- FileTxt = xtmp & vbcrlf & tStream.ReadText()
- tStream.close()
- Set tStream = Nothing
- Call ShowAllFile(TmpPath)
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link rel="stylesheet" rev="stylesheet" href="inc/control.css" type="text/css" media="all" />
- </head>
- <body class="ContentBody">
- <div class="MainDiv">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CContent">
- <tr>
- <th class="CTitle">雷客图ASP站长安全助手 文件校验结果
- </tr>
- <tr>
- <td class="CPanel">
- <div id="updateInfo" style="background:ffffe1;border:1px solid #89441f;padding:4px;display:none"></div>
- 校验完毕!一共检查文件<font color="#FF0000"><%=SumFiles%></font>个,发现新增/改动的<font color="#FF0000"><%=Sun%></font>个
- <form name="form1" method="post" action="admin_fileinfo2.asp">
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td valign="top" style="padding:5px;width:140px"><img src="images/Icon/ControlPanel.png" width="128" height="128"/></td>
- <td valign="top">
- <table width="100%" border="1" cellpadding="0" cellspacing="0" style="padding:5px;line-height:170%;clear:both;font-size:12px">
- <tr>
- <td width="35%">文件相对路径</td>
- <td width="15%">文件大小 bytes</td>
- <td width="50%">创建/修改时间</td>
- </tr>
- <p>
- <%=Report%>
- <br/></p>
- </table>
- </td>
- </tr>
- </table>
- </form>
- </td></tr>
- </table>
- </div>
- <%
- timer2 = timer
- thetime=cstr(int(((timer2-timer1)*10000 )+0.5)/10)
- response.write "<br><font size=""2"">本页执行共用了"&thetime&"毫秒</font>"
- %>
- </body>
- </html>
- <%
- Sub ShowAllFile(Path)
- xlake2 = replace(path,"","\")
- xlake2 = replace(xlake2,"+","+")
- xlake2 = replace(xlake2,".",".")
- xlake2 = replace(xlake2,"[","[")
- xlake2 = replace(xlake2,"]","]")
- xlake2 = replace(xlake2,"{","{")
- xlake2 = replace(xlake2,"}","}")
- Set FSO = CreateObject("Scripting.FileSystemObject")
- if not fso.FolderExists(path) then exit sub
- Set regEx = New RegExp
- regEx.IgnoreCase = True
- regEx.Global = True
- regEx.Pattern = "<"&xlake2&">.*"
- Set Matches = regEx.Execute(filetxt)
- For Each Match in Matches
- Lake2 = Replace(Replace(Match.Value, vbcrlf, ""), "<"&Path&">", "")
- Next
- Set Matches = Nothing
- Set regEx = Nothing
- Set f = FSO.GetFolder(Path)
- Set fc2 = f.files
- For Each myfile in fc2
- SumFiles = SumFiles + 1
- If CheckExt(FSO.GetExtensionName(path&""&myfile.name)) Then
- Temp = myfile.name&"*"&myfile.Size&"*"&myfile.DateLastModified&"|"
- If InStr(1, Lake2, Temp, 1) = 0 Then
- Sun = Sun + 1
- 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>"
- End If
- End If
- Next
- Set fc = f.SubFolders
- For Each f1 in fc
- ShowAllFile path&""&f1.name
- Next
- Set FSO = Nothing
- End Sub
- %>