国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Visual Basic > 正文

VB獲取文件大小的方法

2020-01-31 16:30:48
字體:
供稿:網(wǎng)友

本文實(shí)例講述了VB獲取文件大小的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

<%  ' Copyright (c) 2009, reusablecode.blogspot.com; some rights reserved.  '  ' This work is licensed under the Creative Commons Attribution License. To view  ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California  ' 94305, USA.  ' Retrieve the file size of a given file.  function getFileSize(someFile)    dim fs    dim file    set fs = Server.CreateObject("Scripting.FileSystemObject")    set file = fs.GetFile(Server.MapPath(someFile))    getFileSize = FormatFileSize(file.size)    set file = nothing    set fs = nothing  end function  ' Format a file size in the most practical units.  ' Input: size in bytes  function FormatFileSize(size)    dim units    dim factor    units = Array("B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")    factor = log(size) / 7    FormatFileSize = Round(size / (1024 ^ factor), 2) & units(factor)  end function%>

希望本文所述對(duì)大家的VB程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 荔波县| 玉山县| 包头市| 全州县| 通道| 中超| 锦州市| 墨江| 玉林市| 耿马| 赞皇县| 黄石市| 陵水| 邹城市| 若羌县| 涟源市| 固阳县| 玛曲县| 株洲市| 永新县| 凤城市| 竹北市| 长葛市| 房产| 龙南县| 米易县| 大冶市| 高雄市| 眉山市| 衡阳县| 乐东| 河北省| 佳木斯市| 扎鲁特旗| 邓州市| 漾濞| 略阳县| 商水县| 桓台县| 金乡县| 星子县|