www.gusucode.com > 漂亮的地方旅游景点景观介绍网站源代码 > codesize.asp
<!--#include file="admin/config.asp" --> <% call connend() mytit="系统空间占用" Sub Showspecialspaceinfo(method) dim fso,d,fc,f1,size,showsize,drvpath set fso=server.createobject("scripting.filesystemobject") drvpath=server.mappath("pic") drvpath=left(drvpath,(instrrev(drvpath,"\")-1)) set d=fso.getfolder(drvpath) if method="All" then size=d.size elseif method="Program" then set fc=d.Files for each f1 in fc size=size+f1.size next end if showsize=size & " Byte" if size>1024 then size=(size\1024) showsize=size & " KB" end if if size>1024 then size=(size/1024) showsize=size & " MB" end if if size>1024 then size=(size/1024) showsize=size & " GB" end if response.write "<font face=verdana>" & showsize & "</FONT>" end sub Function Drawbar(drvpath) dim fso,drvpathroot,d,size,totalsize,barsize set fso=server.createobject("scripting.filesystemobject") drvpathroot=server.mappath("pic") drvpathroot=left(drvpathroot,(instrrev(drvpathroot,"\")-1)) set d=fso.getfolder(drvpathroot) totalsize=d.size drvpath=server.mappath(drvpath) set d=fso.getfolder(drvpath) size=d.size barsize=cint((size/totalsize)*400) Drawbar=barsize end Function Function Drawspecialbar() dim fso,drvpathroot,d,fc,f1,size,totalsize,barsize set fso=server.createobject("scripting.filesystemobject") drvpathroot=server.mappath("pic") drvpathroot=left(drvpathroot,(instrrev(drvpathroot,"\")-1)) set d=fso.getfolder(drvpathroot) totalsize=d.size set fc=d.files for each f1 in fc size=size+f1.size next barsize=cint((size/totalsize)*400) Drawspecialbar=barsize end Function Sub ShowSpaceInfo(drvpath) dim fso,d,size,showsize set fso=server.createobject("scripting.filesystemobject") drvpath=server.mappath(drvpath) set d=fso.getfolder(drvpath) size=d.size showsize=size & " Byte" if size>1024 then size=(size\1024) showsize=size & " KB" end if if size>1024 then size=(size/1024) showsize=size & " MB" end if if size>1024 then size=(size/1024) showsize=size & " GB" end if response.write "<font face=verdana>" & showsize & "</FONT>" end Sub call head() %> <link href="admin/inc/mm.css" rel="stylesheet" type="text/css"> <TABLE WIDTH=99%BORDER=0 ALIGN=center cellpadding=1 CELLSPACING=1 bgcolor=#4272D5> <TR> <TD bgcolor=#FFFFFF><TABLE WIDTH=100%BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD id="tit"><a href="admin/main.asp">管理首页</a> >> <%= mytit %></TD> </TR> </TABLE> <TABLE WIDTH=100%BORDER=0 CELLPADDING=0 CELLSPACING=1> <TR> <TD HEIGHT=1 bgcolor=#4272D5></TD> </TR> <TR> <TD><TABLE WIDTH=100%BORDER=0 CELLPADDING=0 CELLSPACING=1> <TR> <TD bgcolor=#FFFFFF> <TABLE WIDTH=100%BORDER=0 CELLPADDING=5 CELLSPACING=1 bgcolor="#FFFFFF"> <% Function GetPP dim s s=Request.ServerVariables("path_translated") GetPP=left(s,instrrev(s,"\",len(s))) End function dim spp,fso,f,fc,i,i2 if sPP="" then sPP=GetPP if right(sPP,1)<>"\" then sPP=sPP&"\" set fso=server.createobject("scripting.filesystemobject") Set f = fso.GetFolder(sPP) Set fc = f.SubFolders i=1 i2=1 For Each f in fc %> <TR> <TD WIDTH=150 bgcolor="#D7ECF7" CLASS=Table8><%= f.name %></TD> <TD bgcolor="#D7ECF7" CLASS=Table8><TABLE WIDTH=100%BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD WIDTH=370><TABLEBORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD WIDTH=1 HEIGHT=10 bgcolor=b50000></TD> <TD WIDTH=1 HEIGHT=10 bgcolor=FFFFFF></TD> <TD WIDTH="<%= drawbar(f.name) %>" HEIGHT=10 bgcolor=b50000></TD> <TD WIDTH="<%= 350-drawbar(f.name) %>" bgcolor=#FFFFFF></TD> <TD WIDTH=1 HEIGHT=10 bgcolor=FFFFFF></TD> <TD WIDTH=1 HEIGHT=10 bgcolor=b50000></TD> </TR> </TABLE></TD> <TD> <%showSpaceinfo(f.name)%></TD> </TR> </TABLE></TD> </TR> <TR bgcolor=ffffff> <TD WIDTH=150 bgcolor="#D7ECF7"></TD> <TD bgcolor="#D7ECF7"></TD> </TR> <% i=i+1 if i2<10 then i2=i2+1 else i2=1 end if Next %> <TR> <TD WIDTH=150 bgcolor="#D7ECF7" CLASS=Table8>根目录文件占用空间</TD> <TD bgcolor="#D7ECF7" CLASS=Table8> <TABLE WIDTH=100%BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD WIDTH=370><TABLEBORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD WIDTH=1 HEIGHT=10 bgcolor=b50000></TD> <TD WIDTH=1 HEIGHT=10 bgcolor=FFFFFF></TD> <TD WIDTH="<%= drawspecialbar %>" HEIGHT=10 bgcolor=b50000></TD> <TD WIDTH="<%= 350-drawspecialbar %>" bgcolor=#FFFFFF></TD> <TD WIDTH=1 HEIGHT=10 bgcolor=FFFFFF></TD> <TD WIDTH=1 HEIGHT=10 bgcolor=b50000></TD> </TR> </TABLE></TD> <TD> <%showSpecialSpaceinfo("Program")%> </TD> </TR> </TABLE></TD> </TR> <TR bgcolor=ffffff> <TD WIDTH=150 bgcolor="#D7ECF7"></TD> <TD bgcolor="#D7ECF7"></TD> </TR> <TR> <TD WIDTH=150 bgcolor="#D7ECF7" CLASS=Table8>系统占用空间总计</TD> <TD bgcolor="#D7ECF7" CLASS=Table8><TABLE WIDTH=100%BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD WIDTH=370><TABLEBORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD WIDTH=1 HEIGHT=10 bgcolor=b50000></TD> <TD WIDTH=1 HEIGHT=10 bgcolor=FFFFFF></TD> <TD WIDTH=350 HEIGHT=10 bgcolor=b50000></TD> <TD WIDTH=0 bgcolor=#FFFFFF></TD> <TD WIDTH=1 HEIGHT=10 bgcolor=FFFFFF></TD> <TD WIDTH=1 HEIGHT=10 bgcolor=b50000></TD> </TR> </TABLE></TD> <TD> <%showspecialspaceinfo("All")%> </TD></TR> </TABLE></TD> </TR> </TABLE></TD> </TR> </TABLE></TD> </TR> </TABLE></TD> </TR> </TABLE> <% call foot() %>