The following is an overview of the FSO's browse file directories by file size and how to delete them:
<%@ Language=vbscript%>
<%Server.ScriptTimeout=50000%>
<HTML>
<HEAD>
<meta name=\ "generator\" content=\ "Microsoft Visual Studio 6.0\" >
<meta http-equiv=\ "content-type\" content=\ "text/html; Charset=gb2312\ ">
</HEAD>
<BODY>
<%
function Judgepararegular (IntID)
If intid<>\ "\" and IsNumeric (IntID) Then
Judgepararegular=intid
Else
Response.Write \ "Input Error!" \"
Response.End
End If
End Function
Intfilesize=judgepararegular (Request.QueryString (\ "Intfilesize\"))
Strpath=request.querystring (\ "Strpath\")
If InStr (strpath,\ ": \") =0 then Strpath=server. MapPath (strpath)
%>
<%
function Deletefiles (path)
On Error Resume Next
Set fs=server.createobject (\ "Scripting.filesystemobject\")
If Fs. FileExists (PATH) Then
Fs. DeleteFile Path,true
Response.Write \ "successfully deleted \" &path
Else
Response.Write \ "File does not exist!\"
End If
Set fs=nothing
If Err.number<>0 then Response.Write err.number
End Function
Strfile=request (\ "Strfile\")
If request (\ "strfile\") <>\ "\" Then
Deletefiles strfile
End If
%>
<%
function Listfolderfiles (Strpath,intfilesize,intflag)
Stroriginpath= Request.ServerVariables (\ "script_name\") & \ "? strpath=\" &request.querystring (\ "StrPath\") & \ "&intfilesize=\" &request.querystring (\ "Intfilesize\")
If strpath<>\ "\" Then
If Intflag=0 Then
Intflag=intflag+1
End If
Set objfs=server.createobject (\ "Scripting.filesystemobject\")
Set Objfdir=objfs.getfolder (strpath)
Strparentpath= Objfs.getparentfoldername (strpath)
For each strsubfiles in Objfdir.files
If Strsubfiles.size/(1024^2) >=intfilesize Then
Response.Write \ "<tr>\" & vbCrLf
Response.Write \ "<td>\" & Replace (Strnulltran (strsubfiles), Strnulltran (strsubfiles.name), \ "<b>\" &strnulltran (strsubfiles.name) &\ "</b>\") & \ "</td>\" & vbCrLf
Response.Write \ "<td>\" & Strnulltran (FormatNumber (Strsubfiles.size/(1024^2), 2)) &\ "MB</TD>\" & vbCrLf
Response.Write \ "<td>\" & Strnulltran (strsubfiles.type) & \ "</td>\" & vbCrLf
Response.Write \ "<td>\" & Strnulltran (strsubfiles.datelastmodified) & \ "</td>\" & vbCrLf
Response.Write \ "<td><a href=\ '" & Stroriginpath & \ "&strfile=\" &strnulltran (strSubFiles) &\ "\ ' ></a></td>\" & vbCrLf
Response.Write \ "</tr>\" & vbCrLf
Intflag=intflag+strsubfiles.size
End If
Next
For each strsubfolders in Objfdir.subfolders
If Intflag=0 then intflag=1
Listfolderfiles Strsubfolders,intfilesize,intflag
Next
Else
Response.Write \ "<TR><TD colspan=5> input Error! </td></tr>\ "
End If
Listfolderfiles=intflag
End Function
function Strnulltran (str)
If IsNull (str) or str=\ "\" Then
Strnulltran=\ "\"
Else
Strnulltran=str
End If
End Function
Response.Write \ "<table width=100% border=1 cellspacing=1 cellpadding=1>\" & vbCrLf
Response.Write \ "<tr>\" & vbCrLf
Response.Write \ "<TD> filename and path </td>\" & vbCrLf
Response.Write \ "<td align=center> size </td>\" & vbCrLf
Response.Write \ "<TD align=center> category </td>\" & vbCrLf
Response.Write \ "<td align=center> modification Time </td>\" & vbCrLf
Response.Write \ "<td align=center> delete </td>\" & vbCrLf
Response.Write \ "</tr>\" & vbCrLf
Intflag=listfolderfiles (Strpath,cdbl (intfilesize), 0)
Response.Write \ "<tr><td align=right> total: </td><td colspan=4>\" &formatNumber (intFlag-1 )/(1024^2), 2 &\ "mb</td></tr>\" & vbCrLf
Response.Write \ "</table>\" & vbCrLf
%>
</BODY>
</HTML>