EDU511 国际专业IT教育服务门户
设为首页   加入收藏    联系我们
寻找IT教育内容合作伙伴
招聘教育网络编辑和运营门户高手
中讯IT教育2008年改版上线
寻找地方站运营伙伴QQ:59955917
中讯IT 技术成就未来
   你现在的位置:首页 >> 新闻系统 >> 程序设计 >> ASP >> ASP实例 >> 正文

检测WEB空间数据库占用空间大小

 
 
日期:08-04-20 21:24:20 点击: 来源:中讯IT
 
Access数据库,使用FSO组件:

'文件字节大小
Function GetFileSize(FileName)
    Dim Fso,drvpath,d,size,showsize
    set Fso = Server.Createobject("Scripting.FileSystemObject")
    drvpath = Server.mappath(FileName)
    set d = Fso.getfile(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 
    set Fso = Nothing
    GetFileSize = showsize
End Function

'strAccessDBName为数据库路径
response.write "Access数据库占用空间:" & GetFileSize(strAccessDBName)

Sql Server数据库,使用SP_Spaceused存储过程:

On error Resume Next
Set rso = Obj.Execute("Exec SP_Spaceused")
If Err <> 0 Then
Err.Clear
Response.Write "未 知"
Else
Response.Write rso(1)
End If
rso.close : Set rso = Nothing
 
责任编辑:
 
前一篇:
后一篇:
相关新闻(文章)

登录模块加载中...
友情链接
重庆之窗 | 重庆IT教育 | 我爱论文网 | 涪陵课件园 | 中国教育导航 | 第一教育网 | 中华IT培训网 
百度网址大全   重庆电脑维修网   华育国际教育 maple story   中国销售培训网    更多友情链接>>>
地址:重庆渝中区大坪正街88号 Copyright © edu511.com All rights reserved.
本站建设得到北京泰胜得风险投资机构、重庆网通信息港、平全教育服务中心与的大力支持            重庆视网科技发展有限公司版权所有 邮编:400041
电话:023-61630611 15902314551            ICP备案号:渝ICP备08002346号 QQ:59955917       邮箱:sysium_yuh@126.com yuhong@edu511.com