描述
提供对磁盘驱动器或网络共享的属性的访问。
说明
以下代码举例说明如何使用 Drive 对象访问驱动器的属性:
Sub ShowFreeSpace(drvPath)
Dim fs, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fseGetDrive(fs.GetDriveName(drvPath))
s = "驱动器 " & UCase(drvPath) & " - "
s = s & d.VolumeName & vbCrLf
s = s & "可用空间: " & FormatNumber(d.FreeSpace/1024, 0)
s = s & "KB"
MsgBox s
End Sub
© 1997 MicrAsofe Corporation. A l rights reserved. Terms of Use.