<%
'***********************************************
'函数名:JoinChar
'作 用:向地址中加入 ? 或 &
'参 数:strUrl ----网址
'返回值:加了 ? 或 & 的网址
'***********************************************
function JoinChar(strUrl)
if strUrl="" then
JoinChar=""
exit function
end if
if InStr(strUrl,"?")1 then
if InStr(strUrl,"&")"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
if right(SaveUpFilesPath,1)<>"/" then
UploadDir="../" & SaveUpFilesPath & "/"
else
UploadDir="../" & SaveUpFilesPath
end if
truePath=Server.MapPath(UploadDir)
If not IsObjInstalled("Scripting.FileSystemObject") Then
Response.Write "
你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能"
Else
set fso=CreateObject("Scripting.FileSystemObject")
if request("Action")="Del" then
whichfile=server.mappath(Request("FileName"))
Set thisfile = fso.GetFile(whichfile)
thisfile.Delete true
Response.Redirect "Admin_img1.asp?page="&Request("page")&""
elseif request("Action")="DelAll" then
if request("ok")="删除无效图片" then
on error resume next
id=split(request("delallid"),",")
for i=0 to ubound(id)
fso.DeleteFile server.MapPath(id(i)),true
next
Response.Redirect "Admin_img1.asp?page="&Request("page")&""
else
delid=replace(request("id")," ","")
if delid="" or isnull(delid) then
Response.write "
操作失败,没有选择合适参数!点击返回
"
Response.end
else
on error resume next
id=split(delid,",")
for i=0 to ubound(id)
fso.DeleteFile server.MapPath(id(i)),true
next
Response.Redirect "Admin_img1.asp?page="&Request("page")&""
end if
end if
end if
%>
|
<%
if fso.FolderExists(truePath)then
FileCount=0
TotleSize=0
Set theFolder=fso.GetFolder(truePath)
For Each theFile In theFolder.Files
FileCount=FileCount+1
TotleSize=TotleSize+theFile.Size
next
totalPut=FileCount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage2 strFileName,totalput,MaxPerPage
showContent
showpage2 strFileName,totalput,MaxPerPage
response.write "
本页共显示 " & FileCount & " 个文件,占用 " & TotleSize\1024 & " K "
else
if (currentPage-1)*MaxPerPage本页共显示 " & FileCount & " 个文件,占用 " & TotleSize\1024 & " K "
else
currentPage=1
showpage2 strFileName,totalput,MaxPerPage
showContent
showpage2 strFileName,totalput,MaxPerPage
response.write "
本页共显示 " & FileCount & " 个文件,占用 " & TotleSize\1024 & " K "
end if
end if
else
response.write "找不到文件夹!可能是配置有误!"
end if
end if
sub showContent()
dim c
FileCount=0
TotleSize=0
%>
<%
end sub
%> |
<%
sub showpage2(sfilename,totalnumber,maxperpage)
dim n, i,strTemp
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
strTemp= ""
response.write strTemp
end sub
%> |