服务器文件夹大小查看器,asp利用FSO检测服务器空间文件夹大小

asp利用FSO检测服务器空间文件夹大小

* {margin:0;padding:0;font-size:12px;}

body {padding:15px;}

.size1 {font-weight:bold;color:#f00;}

.size2 {font-weight:bold;color:#00f;}

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 "" & showsize & ""

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 & " 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 "" & showsize & ""

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

%>

系统空间的使用情况

fsoflag=1

if fsoflag=1 then

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

%>

目录占用空间:

px;">

i=i+1

if i2<10 then

i2=i2+1

else

i2=1

end if

Next

%>

程序文件占用空间:

系统占用空间总计:

else

response.write "本功能已经被关闭"

end if

%>

.sizediv {height:10px;background:#91d65c;border-left:solid 2px #91d65c;}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值