0514-86177077
9:00-17:00(工作日)
对于文件,返回指定文件的字节数;对于文件夹,返回该文件夹中所有文件和子文件夹的字节数。
object.Size
object 应为 File 或 Folder 对象的名称。
以下代码举例说明如何使用 Folder 对象的 Size 属性:
Function ShowFolderSize(filespec) Dim fso, f, s Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(filespec)s = UCase(f.Name) " 大小为 " f.size " 字节。"ShowFolderSize = s End Function
Function ShowFolderSize(filespec) Dim fso, f, s Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(filespec)s = UCase(f.Name) "
" f.size "
"
ShowFolderSize = s
End Function
标签:资阳 昌都 咸宁 通辽 海北 沧州 韶关 阿里
上一篇:VBS教程:属性-SubFolders 属性
下一篇:VBS教程:属性-ShortPath 属性