<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
<TITLE>空间使用情况统计</TITLE>
<link rel="stylesheet" href="Images/Admin.css">
<script language="javascript" src="../Script/Admin.js"></script>
</HEAD>
<!--#include file="../Include/Conn.asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="CheckAdmin.asp"-->
<BODY>
<%
if Instr(session("AdminPurview"),"|35,")=0 then 
    response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
  response.end
end if
'========判断是否具有管理权限
%>
<body>
<br>
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr>
    <td width="140" height="24" nowrap class="title">统计栏目</th>
    <td height="24" nowrap class="title"><strong><font color="#FFFFFF">路径</td>
    <td width="66" nowrap class="title">大小</th>
    <td width="46" nowrap class="title">百分比</th>
    <td width="260" nowrap class="title">图示</th>
  </tr>
  <tr>
    <td height="20" class="forumrow" >系统总占用空间</td>
    <td class="forumrowhighlight" ><%=SysRootDir%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir)),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="260" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >数据库存放文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"Database"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Database"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Database")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Database"))*260%>" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >数据库备份文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"Databasebak"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Databasebak"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Databasebak")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Databasebak"))*260%>" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >网站常规数据库</td>
    <td class="forumrowhighlight" ><%=SysRootDir&SiteDataPath%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&SiteDataPath))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&SiteDataPath)),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&SiteDataPath))*260%>" height="8"></td>
  </tr>

  <tr>
    <td height="20" class="forumrow" >在线编辑器文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"WebEdit"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"WebEdit"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"WebEdit")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"WebEdit"))*260%>" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >网站包含文件</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"Include"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Include"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Include")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Include"))*260%>" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >网站前台JS脚本文件</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"Script"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Script"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Script")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Script"))*260%>" height="8"></td>
  </tr>
    <tr>
    <td height="20" class="forumrow" >前台图片文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"Images"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Images"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Images")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Images"))*260%>" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >文件上传保存目录</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"UploadFiles"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"UploadFiles"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"UploadFiles")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"UploadFiles"))*260%>" height="8"></td>
  </tr>
    <tr>
    <td height="20" class="forumrow" >中文页面文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"ch"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"ch"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"ch")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"ch"))*260%>" height="8"></td>
  </tr>
    <tr>
    <td height="20" class="forumrow" >英文页面文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"en"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"en"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"en")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"en"))*260%>" height="8"></td>
  </tr>
    <tr>
    <td height="20" class="forumrow" >生成中文静态页文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"ch/html"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"ch/html"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"ch/html")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"ch/html"))*260%>" height="8"></td>
  </tr>
    <tr>
    <td height="20" class="forumrow" >生成英文静态页文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"en/html"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"en/html"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"en/html")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"en/html"))*260%>" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >天天广告系统文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"ads"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"ads"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"ads")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"ads"))*260%>" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >管理后台文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"admin"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"admin"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"admin")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"admin"))*260%>" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >管理后台图片文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"admin/Images"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"admin/Images"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"admin/Images")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"admin/Images"))*260%>" height="8"></td>
  </tr>
  <tr>
    <td height="20" class="forumrow" >模板备份文件夹</td>
    <td class="forumrowhighlight" ><%=SysRootDir&"temp"%></td>
    <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"temp"))%></td>
    <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"temp")),,-1)%></td>
    <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"temp"))*260%>" height="8"></td>
  </tr>
</table>
</body>
</html>
<%
'============
function SizeByte(Path)
  dim fso
  set fso=server.createobject("scripting.filesystemobject") 
  Path=server.mappath(Path) 
  if fso.FileExists(Path) then	
 	SizeByte=fso.getfile(Path).size
  elseif fso.FolderExists(Path) then
 	SizeByte=fso.getfolder(Path).size
  else
    SizeByte="PathError"
  end if
end function
'============
function SizeInfo(SizeByte)
  if SizeByte="PathError" then
    SizeInfo="<font color='red'>未找到</font>"
  else
    if SizeByte>=1024*1024*1024 then
      SizeInfo=round(SizeByte/1024/1024/1024,2) & " GB"		
    elseif 1024*1024<=SizeByte and SizeByte<1024*1024*1024 then
      SizeInfo=round(SizeByte/1024/1024,2) & " MB"		
    elseif 1024<=SizeByte and SizeByte<1024*1024 then
      SizeInfo=round(SizeByte/1024,2) & " KB"	
    else
      SizeInfo=SizeByte & " Byte" 
    end if
  end if
end function
'============
function Percent(SizeByte)
  dim fso,SysSizeByte
  set fso=server.createobject("scripting.filesystemobject") 
  if fso.FolderExists(server.mappath(SysRootDir)) and SizeByte<>"PathError"  then
 	SysSizeByte=fso.getfolder(server.mappath(SysRootDir)).size
    Percent=SizeByte/SysSizeByte
  else
    Percent=0
	exit function
  end if
end function
'============
%>