📄 spacesize.asp
字号:
<!--#include file =conn.asp-->
<%
if session("admin")="" then
response.redirect "admin.asp"
else
if session("flag")>1 then
response.write "<br><p align=center>你没有操作权限!</p>"
response.end
end if
end if
%>
<title>管理页面</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta NAME=GENERATOR Content="Microsoft FrontPage 5.0"Microsoft FrontPage 3.0"" CHARSET=GB2312>
<BODY bgcolor="#468ea3">
<table cellpadding=0 cellspacing=0 border=0 align=center>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=550>
<tr>
<td width="100%" valign=top>
<%
on error resume next
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=formatnumber(size,2) & " MB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " 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("../images")
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=formatnumber(size,2) & " MB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " 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("../images")
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("../images")
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
%>
<table width=550 cellspacing=1 cellpadding=0>
<tr>
<td height=25>
系统空间占用情况
</td>
</tr>
<tr>
<td width="500">
<blockquote>
<%
fsoflag=1
if fsoflag=1 then
%>
<br>
数据库占用空间: <img src="../images/bar1.gif" width=<%=drawbar("../backup")%> height=10> <%showSpaceinfo("../backup")%><br><br>
程序文件占用空间: <img src="../images/bar1.gif" width=<%=drawspecialbar%> height=10> <%showSpecialSpaceinfo("Program")%><br><br>
image文件夹占用空间: <img src="../images/bar1.gif" width=<%=drawbar("../image")%> height=10> <%showSpaceinfo("../image")%><br><br>
images文件夹占用空间: <img src="../images/bar1.gif" width=<%=drawbar("../images")%> height=10> <%showSpaceinfo("../images")%><br><br>
js文件夹占用空间: <img src="../images/bar1.gif" width=<%=drawbar("../js")%> height=10> <%showSpaceinfo("../js")%><br><br>
admin文件夹占用空间: <img src="../images/bar1.gif" width=<%=drawbar("../admin")%> height=10> <%showSpaceinfo("../admin")%><br><br>
系统占用空间总计:<br><img src="../images/bar1.gif" width=400 height=10> <%showspecialspaceinfo("All")%>
<%
else
response.write "<br><li>本功能已经被关闭"
end if
%>
</blockquote> </font>
</td>
</tr>
</table>
</td>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -