TotalSize 屬性
返回驅(qū)動器或網(wǎng)絡共享的總字節(jié)數(shù)。
object.TotalSize
object 應為 Drive 對象的名稱。
說明
以下代碼舉例說明如何使用 TotalSize 屬性:
Function ShowSpaceInfo(drvpath) Dim fso, d, s Set fso = CreateObject("Scripting.FileSystemObject") Set d = fso.GetDrive(fso.GetDriveName(fs.GetAbsolutePathName(drvpath))) s = "
驅(qū)動器 " d.DriveLetter ":"
s = s vbCrLf
s = s "
總?cè)萘浚?CODE>" FormatNumber(d.TotalSize/1024, 0) "KB" s = s vbCrLf
s = s "
可用空間:" FormatNumber(d.AvailableSpace/1024, 0) "KB"
ShowSpaceInfo=s
End Function