Dim Fso,FsoFile,FileType,FileSize,FileTime,Path
Dim Dir
Action=Trim(Request("Action"))
Set Fso=Server.CreateObject("Scripting.FileSystemObject")
IsErr
If Action = "Del" then
Call DelAll
Else
Dir=Trim(Request.QueryString("Dir"))
Path = Server.MapPath(UploadFolder) & Dir
Set FsoFile = Fso.GetFolder(Server.MapPath(UploadFolder))
FsoFileSize = FsoFile.size '空间大小统计
Set FsoFile = nothing
Set FsoFile = Fso.GetFolder(Path)
Response.Write("<table class='table' cellSpacing='1' cellPadding='3' width='98%' align='center' border='0'>") &vbCrlf
Response.Write(" <tr>") &vbCrlf
Response.Write(" <td width='80%' class='hback'> 图片主目录:.."&UploadFileDir&" 空间占用:")
Response.Write GetFileSize(FsoFileSize)
Response.Write(" <br />当前目录:<a href='Admin_UpFiles.asp' title='返回主目录'><font color='#FF0000'>..</font></a><font color='#0000FF'>"&Dir&"</font> 占用空间:")
Response.Write GetFileSize(FsoFile.size)
Response.Write(" 其中包括<font color='#FF0000'>"&FsoFile.SubFolders.count&"</font>个文件夹; <font color='red'><b>"&FsoFile.Files.count&"</b></font>个文件</td>") &vbCrlf
Response.Write(" </tr>") &vbCrlf
Response.Write("</table>") &vbCrlf
Response.Write("<form name='form' method='post' action='?Action=Del' style='margin:0'>") &vbCrlf
Response.Write("<table class='table' cellSpacing='1' cellPadding='3' width='98%' align='center' border='0'>") &vbCrlf
Response.Write(" <tr class='xingmu' height='22'>") &vbCrlf
Response.Write(" <th width='10%' height='22' align='center' class='xingmu'>选中</th>") &vbCrlf
Response.Write(" <th width='30%' align='center' class='xingmu'>文件/文件夹名</th>") &vbCrlf
Response.Write(" <th width='10%' align='center' class='xingmu'>类型</th>") &vbCrlf
Response.Write(" <th width='15%' align='center' class='xingmu'>文件大小</th>") &vbCrlf
Response.Write(" <th align='center' class='xingmu'>最后修改时间</th>") &vbCrlf
Response.Write(" </tr>") &vbCrlf
For Each DirFolder in FsoFile.SubFolders
FolderName=DirFolder.name
FolderSize=GetFileSize(DirFolder.size)
FolderTime=DirFolder.DateLastModified
Response.Write(" <tr onMouseOver='overColor(this)' onMouseOut='outColor(this)'> ") &vbCrlf
Response.Write(" <td align='center' class='hback'> <input type='checkbox' name='FolderId' value='"&FolderName&"' onClick=""checkItem(this, 'chkAll')""></td>") &vbCrlf
Response.Write(" <td align='left' class='hback'> <a href=?action=Open&Dir="&Dir&""&FolderName&">"&FolderName&"</a></td>") &vbCrlf
Response.Write(" <td align='center' class='hback'><img src='"&ImageFolder&"/ClosedFolder.gif' width='16' height='16' alt='文件夹'></td>") &vbCrlf
Response.Write(" <td align='center' class='hback'>"&FolderSize&"</td>") &vbCrlf
Response.Write(" <td align='left' class='hback'>"&FolderTime&"</td>") &vbCrlf
Response.Write(" </tr>") &vbCrlf
Next
For Each DirFiles in FsoFile.Files
FileName=DirFiles.name
FileType=GetFileIcon(FileName)
FileSize=GetFileSize(DirFiles.size)
FileTime=DirFiles.DateLastModified
Response.Write(" <tr onMouseOver='overColor(this)' onMouseOut='outColor(this)'>") &vbCrlf
Response.Write(" <td align='center' class='hback'> <input type='checkbox' name='FileId' value='"&FileName&"' onClick=""checkItem(this, 'chkAll')""></td>") &vbCrlf
Response.Write(" <td align='left' class='hback'> <a href='"&UploadFolder&Dir&"/"&FileName&"' target='_blank'>"&FileName&"</a></td>") &vbCrlf
Response.Write(" <td class='hback' align='center'><Img src='"&ImageFolder&"/"&FileType&"' alt='文件' width='16' height='16'></td>") &vbCrlf
Response.Write(" <td align='center' class='hback'>"&FileSize&"</td>") &vbCrlf
Response.Write(" <td align='left' class='hback'>"&FileTime&"</td>") &vbCrlf
Response.Write(" </tr>") &vbCrlf
Next
Response.Write("</table>") &vbCrlf
Response.Write("<table width='98%' border='0' cellspacing='0' cellpadding='0' align='center'>") &vbCrlf
Response.Write(" <tr>") &vbCrlf
Response.Write(" <td width='10%' align='center'><input type='checkbox' name='CheckAll' value='checkbox' onClick=""checkAll(this, 'FileId')""></td>") &vbCrlf
Response.Write(" <td colspan='4' height='30'> <input name='Del' type='submit' class='Button' id='Del' style='cursor:hand' value=' 删 除 ' onClick=""{if(confirm('确定删除选定文件或者文件夹吗!?')){this.document.form.submit();return true;}return false;}""> <input type='hidden' name='ThisDir' value='"&Dir&"'> <input name='aa' type='button' class='Button' id='aa' value='返回图片目录' onClick=""javascript:window.location.href='Admin_UpFiles.asp';""></td>") &vbCrlf
Response.Write(" </tr>") &vbCrlf
Response.Write("</table>") &vbCrlf
Response.Write("</form>") &vbCrlf
End If
Set FsoFile = nothing
Set Fso = nothing