對于文件,返回指定文件的字節(jié)數(shù);對于文件夾,返回該文件夾中所有文件和子文件夾的字節(jié)數(shù)。
object.Size
object 應(yīng)為 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 & "字節(jié)。"ShowFolderSize = sEnd Function
新聞熱點(diǎn)
疑難解答
圖片精選