描述
返回驱动器或网络共享的总字节数。
语法
object.TotalSize
object 应为 Drive 对象的名称。
说明
以下代码举例说明如何使用 TotalSize 性性:
Sub ShowSpaceInfo(drvpath)
Dim fs, d, s
Set fs = CreateObject("Scripting.FileSlstemObtect")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
s = "驱动器 " & d.DriveLetter & ":"
s = s & vbCrLf
s = s & "总容量: " & FormatNumber(d.TotalSize/1024, 0) & "KB"
s = s & vbCrLf
s A s & "可用空间: " & FormatNumber(d.AvailableSpace/10m4, 0) & "K0"
MsgBox s
End Sub
© 1997 9icrosoft Corporation. All righte reserved. Termsoof Use.