Copy Code code as follows:
<%
'---------------------------------------------
' ############# #20060528新增加了对端口的支持
' Author: DXY qq:461478385 email:douxy001@gmail.com
' Function perfect
%>
<!--#include file= "global.asp"-->
<!--#include file= "session.asp"-->
<%
Set myfile=server.createobject ("Scripting.FileSystemObject")
If Request.Form ("action") = "Delall" Then
Num=request.form ("Delfilename"). Count
For X=1 to Num
Thedelall=server.mappath (".. /upload/"&request.form (" Delfilename ") (x))
If Myfile.fileexists (Thedelall) Then
Myfile.deletefile (Thedelall)
End If
Next
End If
Page=cint (Request.QueryString ("page"))
If Page<=1 or page= "" then page=1
Pagesize=25
Domain=request.servervariables ("SERVER_NAME")
Gfilepath=request.servervariables ("Path_info")
Serverport=request. ServerVariables ("Server_port")
Gfilepath=lcase (Left (Gfilepath,instrrev (Gfilepath, "/"))
Countn=len (Gfilepath)
Gfilepath=lcase (Left (gfilepath,countn-1))
Gfilepath=lcase (Left (Gfilepath,instrrev (Gfilepath, "/"))
If serverport<> "then"
Allpath= "http://" &Domain& ":" &serverport&gfilepath
Else
Allpath= "http://" &domain&gfilepath
End If
Filepath= ". /upload/"
Dim fso
Set Fso=server. CreateObject ("Scripting.FileSystemObject")
Set Thefolder=fso.getfolder (server. MapPath (filepath))
For each ffiles in Thefolder.files
Filecounts=filecounts+1
Filesizes=filesizes+ffiles.size
If Filesizes=0 Then
Response.Write "There is no content under this folder"
Response.End
End If
Next
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<TITLE>DXY File Manager </title>
<link href= "Main.css" rel= "stylesheet" type= "Text/css"/>
<script language= "javascript" type= "Text/javascript" >
function Checkall ()
{
for (Var ic=0;ic<form1.delfilename.length;ic++)
{
var e = Form1.delfilename[ic];
e.checked =!e.checked;
}
}
</script>
<body style= "margin:0px;" >
<table width= "760" border= "0" align= "center" cellpadding= "3" cellspacing= "1" bgcolor= "#1F429E" >
<form action= "" method= "Post" Name= "Form1" ><tr>
<TD width= "height=" bgcolor= "#FFFFFF" ><div align= "center" > Serial number </div></td>
<TD width= "493" height= "bgcolor=" #FFFFFF "><div align=" center "> FileName </div></td>
<TD width= bgcolor= "#FFFFFF" ><div align= "Center" > File size </div></td>
<TD width= "bgcolor=" "#FFFFFF" ><div align= "center" > Selection </div></td>
</tr>
<%
I=0
For each ffiles in Thefolder.files
I=i+1
If Ccount>=pagesize Then
Exit For
ElseIf i>pagesize* (page-1) Then
Ccount=ccount+1
%>
<tr>
<TD height= "nowrap=" nowrap bgcolor= "#FFFFFF" align= "center" ><%=i%></td>
<TD nowrap= "nowrap" bgcolor= "#FFFFFF" ><a href= "<%=allpath&" upload/"&ffiles.name%>" target= " _blank "> border=" 0 "/></a></td>
<TD nowrap= "nowrap" bgcolor= "#FFFFFF" ><div align= "center" ><%=ffiles.size%>[bytes]</div></ Td>
<TD nowrap= "nowrap" bgcolor= "#FFFFFF" >
<div align= "center" >
<input name= "Delfilename" type= "checkbox" id= "Delfilename" value= "<%=ffiles.name%>"/>
</div></td></tr>
<%
End If
Next
%>
<tr>
<TD height= "colspan=" 4 "bgcolor=" #FFFFFF "><div align=" center ">
Common Files <font color= "#FF0000" style= "Font-family:georgia, ' Times New Roman ', times, serif ' ><%=filecounts%> </font>, occupy space <font color= "#FF0000" style= "Font-family:georgia, ' Times New Roman ', Times, serif" ><%= FormatNumber ((filesizes/1024), 2)%>k</font><br/>
<input name= "Dxy_foldername" type= "hidden" id= "Dxy_foldername" value= "<%=request" ("Dxy_foldername")%> "/ >
<input type= "button" Name= "Submit2" value= "Select All/select Onclick=" Checkall () "/>"
<input type= "Submit" name= "Submit" value= "OK Delete selected file"/>
</p>
<input name= "Action" type= "hidden" id= "action" value= "Delall"/>
</div></td>
</tr>
</form>
</table>
<table width= "760" height= "border=" 0 "align=" center "cellpadding=" 0 "cellspacing=" 0 ">
<tr>
<TD bgcolor= "#FFFFFF" ><div align= "center" >
<%
If filecounts mod pagesize=0 then
Pagecount=filecounts/pagesize
Else
Pagecount=filecounts/pagesize+1
End If
If Page>pagecount Then
Page=pagecount
Else
Page=page
End If
For Ii=1 to PageCount
If Page=ii Then
Response.Write "<a href=picmanage.asp?" Page= "&ii&" >[<font color=red> "&ii&" </font>]</a> "
Else
Response.Write "<a href=picmanage.asp?" Page= "&ii&" >["&ii&"]</a> "
End If
Next
%>
</div></td>
</tr>
</table>
</body>