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 屬性
Copyright ? 1999-2012 誠信 合法 規范的巨人網絡通訊始建于2005年
蘇ICP備15040257號-8