<thead id="jxdzp"><address id="jxdzp"><pre id="jxdzp"></pre></address></thead>

<em id="jxdzp"><span id="jxdzp"></span></em>

    <listing id="jxdzp"><nobr id="jxdzp"><meter id="jxdzp"></meter></nobr></listing>

      <address id="jxdzp"></address>
      <noframes id="jxdzp"><form id="jxdzp"><th id="jxdzp"></th></form>
      <noframes id="jxdzp"><form id="jxdzp"><th id="jxdzp"></th></form>

          訂閱本欄目 RSS您所在的位置: 深山工作室 > ASP > 正文

          asp利用FSO檢測服務器空間文件夾大小

          深山行者個人網站 2009/8/17 9:00:37 深山行者 字體: 瀏覽 9036

          asp利用FSO檢測服務器空間文件夾大小

          <style type="text/css">
          * {margin:0;padding:0;font-size:12px;}
          body {padding:15px;}
          .size1 {font-weight:bold;color:#f00;}
          .size2 {font-weight:bold;color:#00f;}
          </style>

          <%
          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 "<span class='size1'>" & showsize & "</span>"
          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 "<span class='size2'>" & showsize & "</span>"
          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
          %>

          系統空間的使用情況<br>

          <%
          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
          %>

          目錄<b><%=f.name%></b>占用空間:

          <div class="sizediv" style="width:<%=drawbar(""&f.name&"")%>px;"></div><%showSpaceinfo(""&f.name&"")%><br>

          <%
              i=i+1
              if i2<10 then
              i2=i2+1
              else
              i2=1
              end if
              Next
          %>
          程序文件占用空間:
          <div class="sizediv" style="width:<%=drawspecialbar%>px;"></div><%showSpecialSpaceinfo("Program")%><br>

          系統占用空間總計:
          <div class="sizediv" style="width:400px;"></div><%showspecialspaceinfo("All")%>

          <%
              else
              response.write "本功能已經被關閉"
              end if
          %>

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

          相關閱讀
          網上購物車購物數量加減效果
          定制開發微信小程序的操作流程
          css a標簽與如何利用css中text-indent實現文章縮進
          關于深山旅行社演示網站一些錯誤
          19寸寬屏旅行社網站默認模板
          在網頁標題欄上或收藏夾前面顯示網站ico小圖標的方法
          Vista中使用IIS 7.0三個常見問題
          汽配公司
          共有0條關于《asp利用FSO檢測服務器空間文件夾大小》的評論
          發表評論
          正在加載評論......
          返回頂部發表評論
          呢 稱:
          表 情:
          內 容:
          評論內容:不能超過 1000 字,需審核,請自覺遵守互聯網相關政策法規。
          驗證碼: 驗證碼 
          網友評論聲明,請自覺遵守互聯網相關政策法規。

          您發布的評論即表示同意遵守以下條款:
          一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權益;
          二、不得發布國家法律、法規明令禁止的內容;互相尊重,對自己在本站的言論和行為負責;
          三、本站對您所發布內容擁有處置權。

          更多信息>>欄目類別選擇
          百度小程序開發
          微信小程序開發
          微信公眾號開發
          uni-app
          asp函數庫
          ASP
          DIV+CSS
          HTML
          python
          更多>>同類信息
          ASP中Utf-8與Gb2312編碼轉換亂碼問題的解決方法頁面編碼聲明
          asp顯示隨機密碼
          通過阿里云服務接口獲得ip地址詳細信息
          iis點開后任務欄上有顯示,但是窗口看不到的解決辦法
          RSA加密解密插件
          微軟Encoder加密解密函數
          更多>>最新添加文章
          dw里面查找替換使用正則刪除sqlserver里面的CONSTRAINT
          Android移動端自動化測試:使用UIAutomatorViewer與Selenium定位元素
          抖音直播音掛載小雪花 懂車帝小程序
          javascript獲取瀏覽器指紋可以用來做投票
          火狐Mozilla Firefox出現:無法載入您的Firefox配置文件 它可能已經丟失 或是無法訪問 問題解決集合處理辦法
          在Android、iOS、Windows、MacOS中微信小程序的文件存放路徑
          python通過代碼修改pip下載源讓下載庫飛起
          python里面requests.post返回的res.text還有其它的嗎
          更多>>隨機抽取信息
          微信公眾號回復文本消息或用客服接口推送文本消息
          在Android、iOS、Windows、MacOS中微信小程序的文件存放路徑
          支持IE與firefox(火狐)的css寫省略號方法
          radio組選擇詳細
          深山仿QQ愛墻最新版--新的一年,新的界面,新的功能
          javascript表格內移動上下列,可以做成ajax加上動態程序做成上下移動順序
          88国产精品视频一区二区三区