📄 admin_spacesize.asp
字号:
<%
dim spacePath,fso
spacePath=Server.MapPath("..")
Set fso=Server.CreateObject("Scripting.FileSystemObject")
if Request("operate")="xmltree" then
response.Buffer=true
response.ContentType="text/xml"
Set myFolder=fso.GetFolder(spacePath)
response.Write("<?xml version=""1.0"" encoding=""gb2312""?><root>"&vbnewline)
Response.write countfilesize(myFolder.size)
folderList spacePath
response.write("</root>")
Sub folderList(Path)
dim myFolder
Set myFolder=fso.GetFolder(Path)
Set sf=myFolder.SubFolders
for each obj In sf
Response.write "<folder><dir>目录:"&obj.Name&"</dir><space>占用空间:"&countfilesize(obj.size)&"</space>"
folderList obj.path
Response.write "</folder>"&vbnewline
next
End Sub
else
spaceList
end if
function spaceSize(path,showmode)
dim myfolder,spacePath,rootSize,childSize
if showmode=1 then
set rootFolder=fso.getFolder(Server.MapPath("../"))
rootSize=rootFolder.size
end if
spacePath=Server.MapPath(path)
set myFolder=fso.getFolder(spacePath)
childSize=myFolder.size
if showmode=1 then
spaceSize=childSize/rootSize
spaceSize=FormatNumber(500*spaceSize,0,-1)&"px"
elseif showmode=0 then
spaceSize=countfilesize(childSize)
end if
end function
function countfilesize(objsize)
if objsize<>"" then
countfilesize=objsize
if countfilesize>=1024 and countfilesize<1048576 then
countfilesize=countfilesize/1024
countfilesize=FormatNumber(countfilesize,2,-1)&"KB"
elseif countfilesize>=1048576 and countfilesize<1073741824 then
countfilesize=countfilesize/1048576
countfilesize=FormatNumber(countfilesize,2,-1)&"MB"
else
countfilesize=countfilesize&"byte"
end if
else
exit function
end if
end function
Sub spaceList()%>
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="text table_border mainTable">
<tr>
<td height="32" colspan="2" align="center" valign="middle" class="td_titleT">空间使用情况</td>
</tr>
<tr valign="middle" class="td_bgcolor">
<td width="*" height="24" align="right">系统数据占用空间:</td>
<td width="85%"><div style="background:#C4F3FF;border:1px solid #00C0F0;width:500px;"><span style="background:#84E7FF;width:<%=spaceSize(datapath,1)%>;"></span><%=spaceSize(datapath,0)%></div></td>
</tr>
<tr valign="middle" class="td_bgcolor">
<td height="24" align="right">备份数据占用空间:</td>
<td><div style="background:#C4F3FF;border:1px solid #00C0F0;width:500px;"><span style="background:#84E7FF;width:<%=spaceSize(databackup,1)%>;"></span><%=spaceSize(databackup,0)%></div></td>
</tr>
<tr valign="middle" class="td_bgcolor">
<td height="24" align="right">XML数据占用空间:</td>
<td><div style="background:#C4F3FF;border:1px solid #00C0F0;width:500px;"><span style="background:#84E7FF;width:<%=spaceSize("../xml",1)%>;"></span><%=spaceSize("../xml",0)%></div></td>
</tr>
<tr valign="middle" class="td_bgcolor">
<td height="24" align="right">系统图片占用空间:</td>
<td><div style="background:#C4F3FF;border:1px solid #00C0F0;width:500px;"><span style="background:#84E7FF;width:<%=spaceSize("../images",1)%>;"></span><%=spaceSize("../images",0)%></div></td>
</tr>
<tr valign="middle" class="td_bgcolor">
<td height="24" align="right">上传文件占用空间:</td>
<td><div style="background:#C4F3FF;border:1px solid #00C0F0;width:500px;"><span style="background:#84E7FF;width:<%=spaceSize("../upfile",1)%>;"></span><%=spaceSize("../upfile",0)%></div></td>
</tr>
<tr valign="middle" class="td_bgcolor">
<td height="24" align="right">样式风格占用空间:</td>
<td><div style="background:#C4F3FF;border:1px solid #00C0F0;width:500px;"><span style="background:#84E7FF;width:<%=spaceSize("../skins",1)%>;"></span><%=spaceSize("../skins",0)%></div></td>
</tr>
<tr valign="middle" class="td_bgcolor">
<td height="24" align="right">广告文件占用空间:</td>
<td><div style="background:#C4F3FF;border:1px solid #00C0F0;width:500px;"><span style="background:#84E7FF;width:<%=spaceSize("../adfile",1)%>;"></span><%=spaceSize("../adfile",0)%></div></td>
</tr>
<tr valign="middle" class="td_bgcolor">
<td height="24" align="right">系统程序占用空间:</td>
<td><div style="background:#C4F3FF;border:1px solid #00C0F0;width:500px;"><span style="background:#84E7FF;width:<%=spaceSize("../",1)%>;text-align:right;"><%=spaceSize("../",0)%></span></div></td>
</tr>
<tr valign="middle" class="td_bgcolor">
<td height="24" colspan="2" align="right"><a href="admin_spacesize.asp?operate=xmltree" target="_black">遍历文件树</a></td>
</tr>
</table>
<%end sub
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -