<%@language=vbscript codepage=936 %>
<%
CacheName = Replace(Replace(Replace(Replace(Server.MapPath("index.asp"), "index.asp", ""), ":", ""), "\", ""), "admin", "")
If session(CacheName & "AdminName") = "" Then
	Response.redirect "admin/login.asp"
	Response.End
End If
%>
<html>
<title>系统空间占用</title>
<link href="admin/style.css" rel="stylesheet" type="text/css">
<meta NAME=GENERATOR Content=""Microsoft FrontPage 3.0"" CHARSET=GB2312>
<BODY topmargin="20">

<p>
  <table cellpadding=0 cellspacing=0 border=0 width=95% align=center>
</p>
<tr>

  <table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
    <tr>
      <th colspan="2"><div align="center">系统空间的使用情况 </th>
	</tr>
	    <tr>

      <td width="80%" valign=top class="forumRow"> <div align="center">
	  <%
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 & "&nbsp;Byte"
	If Size>1024 Then
		Size = (Size \ 1024)
		showsize = Size & "&nbsp;KB"
	End If
	If Size>1024 Then
		Size = (Size / 1024)
		showsize = FormatNumber(Size, 2) & "&nbsp;MB"
	End If
	If Size>1024 Then
		Size = (Size / 1024)
		showsize = FormatNumber(Size, 2) & "&nbsp;GB"
	End If
	response.Write "<font face=verdana>" & showsize & "</font>"
End Sub

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 & "&nbsp;Byte"
	If Size>1024 Then
		Size = (Size \ 1024)
		showsize = Size & "&nbsp;KB"
	End If
	If Size>1024 Then
		Size = (Size / 1024)
		showsize = FormatNumber(Size, 2) & "&nbsp;MB"
	End If
	If Size>1024 Then
		Size = (Size / 1024)
		showsize = FormatNumber(Size, 2) & "&nbsp;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

%>
	</div>
	<table width=550 align="center" cellpadding=0 cellspacing=1 >

 				<tr>
 					<td> 			
 			<blockquote> 			
 			<%
fsoflag = 1
If fsoflag = 1 Then

%>
 			<br>
 			<%Function GetPP
	Dim s
	s = Request.ServerVariables("path_translated")
	GetPP = Left(s, instrrev(s, "\", Len(s)))
End Function

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
%>	
 			目录<b><%=f.name%></b>占用空间：&nbsp;<img src="admin/images/bar.gif" width=<%=drawbar(""&f.name&"")%> height=10>&nbsp;<%showSpaceinfo(""&f.name&"")%><br><br>
 			<%i = i + 1
If i2<10 Then
	i2 = i2 + 1
Else
	i2 = 1
End If
Next
%>
 			程序文件占用空间：&nbsp;<img src="admin/images/bar.gif" width=<%=drawspecialbar%> height=10>&nbsp;<%showSpecialSpaceinfo("Program")%><br><br>
 			系统占用空间总计：<br><img src="admin/images/bar.gif" width=400 height=10> <%showspecialspaceinfo("All")%>
 			<%
Else
	response.Write "<br><li>本功能已经被关闭"
End If

%>
 			</blockquote>
 					</td>
 				</tr>
 			</table>
 		
    </body></html>
