getFileSize 获得文件大小

getFileSize 获得文件大小,第1张

概述getFileSize 获得文件大小

下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。

内存溢出小编现在分享给大家,也给大家做个参考。

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

以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

总结

以上是内存溢出为你收集整理的getFileSize 获得文件大小全部内容,希望文章能够帮你解决getFileSize 获得文件大小所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1274830.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存