SpaceStat.asp
上传用户:mtjhgs
上传日期:2021-12-08
资源大小:3755k
文件大小:9k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <HTML xmlns="http://www.w3.org/1999/xhtml">
  2. <HEAD>
  3. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
  4. <TITLE>防注入记录</TITLE>
  5. <link rel="stylesheet" href="Images/Admin.css">
  6. <script language="javascript" src="../Script/Admin.js"></script>
  7. </HEAD>
  8. <!--#include file="../Include/Const.asp" -->
  9. <!--#include file="../Include/ConnSiteData.asp" -->
  10. <!--#include file="CheckAdmin.asp"-->
  11. <BODY>
  12. <%
  13. if Instr(session("AdminPurview"),"|38,")=0 then 
  14.     response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限!</font></div>")
  15.   response.end
  16. end if
  17. '========判断是否具有管理权限
  18. %>
  19. <body>
  20. <br>
  21. <table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
  22.   <tr>
  23.     <td width="140" height="24" nowrap class="title">统计栏目</th>
  24.     <td height="24" nowrap class="title"><strong><font color="#FFFFFF">路径</td>
  25.     <td width="66" nowrap class="title">大小</th>
  26.     <td width="46" nowrap class="title">百分比</th>
  27.     <td width="260" nowrap class="title">图示</th>
  28.   </tr>
  29.   <tr>
  30.     <td height="20" class="forumrow" >系统总占用空间</td>
  31.     <td class="forumrowhighlight" ><%=SysRootDir%></td>
  32.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir))%></td>
  33.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir)),,-1)%></td>
  34.     <td class="forumrow" ><img src="images/bar.gif" width="260" height="8"></td>
  35.   </tr>
  36.   <tr>
  37.     <td height="20" class="forumrow" >页面文件夹</td>
  38.     <td class="forumrowhighlight" ><%=SysRootDir&"Ch"%></td>
  39.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Ch"))%></td>
  40.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Ch")),,-1)%></td>
  41.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Ch"))*260%>" height="8"></td>
  42.   </tr>
  43.   <tr>
  44.     <td height="20" class="forumrow" >流量统计文件夹</td>
  45.     <td class="forumrowhighlight" ><%=SysRootDir&"Count"%></td>
  46.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Count"))%></td>
  47.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Count")),,-1)%></td>
  48.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Count"))*260%>" height="8"></td>
  49.   </tr>
  50.   <tr>
  51.     <td height="20" class="forumrow" >数据库存放文件夹</td>
  52.     <td class="forumrowhighlight" ><%=SysRootDir&"Database"%></td>
  53.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Database"))%></td>
  54.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Database")),,-1)%></td>
  55.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Database"))*260%>" height="8"></td>
  56.   </tr>
  57.   <tr>
  58.     <td height="20" class="forumrow" >网站常规数据库</td>
  59.     <td class="forumrowhighlight" ><%=SysRootDir&SiteDataPath%></td>
  60.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&SiteDataPath))%></td>
  61.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&SiteDataPath)),,-1)%></td>
  62.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&SiteDataPath))*260%>" height="8"></td>
  63.   </tr>
  64.   <tr>
  65.     <td height="20" class="forumrow" >网站备份数据库</td>
  66.     <td class="forumrowhighlight" ><%=SysRootDir&SiteDataBakPath%></td>
  67.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&SiteDataBakPath))%></td>
  68.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&SiteDataBakPath)),,-1)%></td>
  69.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&SiteDataBakPath))*260%>" height="8"></td>
  70.   </tr>
  71.   <tr>
  72.     <td height="20" class="forumrow" >流量常规数据库</td>
  73.     <td class="forumrowhighlight" ><%=SysRootDir&StatDataPath%></td>
  74.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&StatDataPath))%></td>
  75.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&StatDataPath)),,-1)%></td>
  76.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&StatDataPath))*260%>" height="8"></td>
  77.   </tr>
  78.   <tr>
  79.     <td height="20" class="forumrow" >流量备份数据库</td>
  80.     <td class="forumrowhighlight" ><%=SysRootDir&StatDataBakPath%></td>
  81.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&StatDataBakPath))%></td>
  82.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&StatDataBakPath)),,-1)%></td>
  83.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&StatDataBakPath))*260%>" height="8"></td>
  84.   </tr>
  85.   <tr>
  86.     <td height="20" class="forumrow" >在线编辑器文件夹</td>
  87.     <td class="forumrowhighlight" ><%=SysRootDir&"Editor"%></td>
  88.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Editor"))%></td>
  89.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Editor")),,-1)%></td>
  90.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Editor"))*260%>" height="8"></td>
  91.   </tr>
  92.   <tr>
  93.     <td height="20" class="forumrow" >网站包含文件</td>
  94.     <td class="forumrowhighlight" ><%=SysRootDir&"Include"%></td>
  95.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Include"))%></td>
  96.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Include")),,-1)%></td>
  97.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Include"))*260%>" height="8"></td>
  98.   </tr>
  99.   <tr>
  100.     <td height="20" class="forumrow" >网站前台JS脚本文件</td>
  101.     <td class="forumrowhighlight" ><%=SysRootDir&"Script"%></td>
  102.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"Script"))%></td>
  103.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"Script")),,-1)%></td>
  104.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"Script"))*260%>" height="8"></td>
  105.   </tr>
  106.   <tr>
  107.     <td height="20" class="forumrow" >管理后台文件夹</td>
  108.     <td class="forumrowhighlight" ><%=SysRootDir&"admin"%></td>
  109.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"admin"))%></td>
  110.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"admin")),,-1)%></td>
  111.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"admin"))*260%>" height="8"></td>
  112.   </tr>
  113.   <tr>
  114.     <td height="20" class="forumrow" >管理后台图片文件夹</td>
  115.     <td class="forumrowhighlight" ><%=SysRootDir&"admin/Images"%></td>
  116.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"admin/Images"))%></td>
  117.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"admin/Images")),,-1)%></td>
  118.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"admin/Images"))*260%>" height="8"></td>
  119.   </tr>
  120.   <tr>
  121.     <td height="20" class="forumrow" >文件上传保存目录</td>
  122.     <td class="forumrowhighlight" ><%=SysRootDir&"upload"%></td>
  123.     <td class="forumrow" ><%=SizeInfo(SizeByte(SysRootDir&"upload"))%></td>
  124.     <td class="forumrowhighlight" ><%=FormatPercent(Percent(SizeByte(SysRootDir&"upload")),,-1)%></td>
  125.     <td class="forumrow" ><img src="images/bar.gif" width="<%=Percent(SizeByte(SysRootDir&"upload"))*260%>" height="8"></td>
  126.   </tr>
  127. </table>
  128. </body>
  129. </html> 
  130. <%
  131. '============
  132. function SizeByte(Path)
  133.   dim fso
  134.   set fso=server.createobject("scripting.filesystemobject") 
  135.   Path=server.mappath(Path) 
  136.   if fso.FileExists(Path) then
  137.   SizeByte=fso.getfile(Path).size
  138.   elseif fso.FolderExists(Path) then
  139.   SizeByte=fso.getfolder(Path).size
  140.   else
  141.     SizeByte="PathError"
  142.   end if
  143. end function
  144. '============
  145. function SizeInfo(SizeByte)
  146.   if SizeByte="PathError" then
  147.     SizeInfo="<font color='red'>未找到</font>"
  148.   else
  149.     if SizeByte>=1024*1024*1024 then
  150.       SizeInfo=round(SizeByte/1024/1024/1024,2) & " GB"
  151.     elseif 1024*1024<=SizeByte and SizeByte<1024*1024*1024 then
  152.       SizeInfo=round(SizeByte/1024/1024,2) & " MB"
  153.     elseif 1024<=SizeByte and SizeByte<1024*1024 then
  154.       SizeInfo=round(SizeByte/1024,2) & " KB"
  155.     else
  156.       SizeInfo=SizeByte & " Byte" 
  157.     end if
  158.   end if
  159. end function
  160. '============
  161. function Percent(SizeByte)
  162.   dim fso,SysSizeByte
  163.   set fso=server.createobject("scripting.filesystemobject") 
  164.   if fso.FolderExists(server.mappath(SysRootDir)) and SizeByte<>"PathError"  then
  165.   SysSizeByte=fso.getfolder(server.mappath(SysRootDir)).size
  166.     Percent=SizeByte/SysSizeByte
  167.   else
  168.     Percent=0
  169. exit function
  170.   end if
  171. end function
  172. '============
  173. %>